Author: ts
Date: Mon Sep 24 14:47:45 2007
New Revision: 6245
Log:
- Fixed issues with trailing spaces in URIs in path factory.
- Fixed constructor of display information struct.
Modified:
trunk/Webdav/src/path_factory.php
trunk/Webdav/src/structs/display_information.php
trunk/Webdav/tests/classes/rfc_path_factory.php
trunk/Webdav/tests/clients/rfc/get_collection/request/result.ser
trunk/Webdav/tests/clients/rfc/get_collection/request/uri.txt
trunk/Webdav/tests/clients/rfc/get_collection/response/headers.php
trunk/Webdav/tests/clients/rfc/get_collection/response/result.ser
trunk/Webdav/tests/clients/rfc/get_resource/request/result.ser
trunk/Webdav/tests/clients/rfc/get_resource/response/result.ser
trunk/Webdav/tests/clients/rfc/options/request/result.ser
trunk/Webdav/tests/clients/rfc/options/response/result.ser
Modified: trunk/Webdav/src/path_factory.php
==============================================================================
--- trunk/Webdav/src/path_factory.php [iso-8859-1] (original)
+++ trunk/Webdav/src/path_factory.php [iso-8859-1] Mon Sep 24 14:47:45 2007
@@ -59,7 +59,7 @@
*/
public function parseUriToPath( $uri )
{
- $requestPath = parse_url( $uri, PHP_URL_PATH );
+ $requestPath = parse_url( trim( $uri ), PHP_URL_PATH );
if ( substr( $requestPath, -1, 1 ) === '/' )
{
$requestPath = substr( $requestPath, 0, -1 );
@@ -86,7 +86,7 @@
. ( isset( $this->baseUriParts['user'] ) || isset(
$this->baseUriParts['pass'] ) ? '@' : '' )
. $this->baseUriParts['host']
. ( isset( $this->baseUriParts['path'] ) ?
$this->baseUriParts['path'] : '' )
- . $path
+ . trim( $path )
. ( isset( $this->baseUriParts['query'] ) ? '?' .
$this->baseUriParts['query'] : '' )
. ( isset( $this->baseUriParts['fragment'] ) ? '#' .
$this->baseUriParts['fragment'] : '' );
}
Modified: trunk/Webdav/src/structs/display_information.php
==============================================================================
--- trunk/Webdav/src/structs/display_information.php [iso-8859-1] (original)
+++ trunk/Webdav/src/structs/display_information.php [iso-8859-1] Mon Sep 24
14:47:45 2007
@@ -25,10 +25,10 @@
* Creates a new struct.
*
* @param ezcWebdavResponse $response
- * @param DOMDocument $body
+ * @param DOMDocument|string|null $body
* @return void
*/
- public function __construct( ezcWebdavResponse $response, DOMDocument
$body = null )
+ public function __construct( ezcWebdavResponse $response, $body = null )
{
$this->response = $response;
$this->body = $body;
Modified: trunk/Webdav/tests/classes/rfc_path_factory.php
==============================================================================
--- trunk/Webdav/tests/classes/rfc_path_factory.php [iso-8859-1] (original)
+++ trunk/Webdav/tests/classes/rfc_path_factory.php [iso-8859-1] Mon Sep 24
14:47:45 2007
@@ -1,6 +1,6 @@
<?php
-class ezcWebdavRfcPathFactory
+class ezcWebdavRfcPathFactory extends ezcWebdavPathFactory
{
public static function parsePath( $requestPath, $base = null )
{
Modified: trunk/Webdav/tests/clients/rfc/get_collection/request/result.ser
==============================================================================
Binary files - no diff available.
Modified: trunk/Webdav/tests/clients/rfc/get_collection/request/uri.txt
==============================================================================
--- trunk/Webdav/tests/clients/rfc/get_collection/request/uri.txt [iso-8859-1]
(original)
+++ trunk/Webdav/tests/clients/rfc/get_collection/request/uri.txt [iso-8859-1]
Mon Sep 24 14:47:45 2007
@@ -1,1 +1,1 @@
-http://www.ics.uci.edu/~fielding
+http://www.ics.uci.edu/~fielding/
Modified: trunk/Webdav/tests/clients/rfc/get_collection/response/headers.php
==============================================================================
--- trunk/Webdav/tests/clients/rfc/get_collection/response/headers.php
[iso-8859-1] (original)
+++ trunk/Webdav/tests/clients/rfc/get_collection/response/headers.php
[iso-8859-1] Mon Sep 24 14:47:45 2007
@@ -2,7 +2,7 @@
return array (
'Content-Length' => '8',
- 'Content-Type' => "utf-8"',
+ 'Content-Type' => '"utf-8"',
);
?>
Modified: trunk/Webdav/tests/clients/rfc/get_collection/response/result.ser
==============================================================================
--- trunk/Webdav/tests/clients/rfc/get_collection/response/result.ser
[iso-8859-1] (original)
+++ trunk/Webdav/tests/clients/rfc/get_collection/response/result.ser
[iso-8859-1] Mon Sep 24 14:47:45 2007
@@ -1,6 +1,2 @@
-a:2:{s:7:"headers";a:1:{i:0;s:22:"HTTP/1.1 404 Not
Found";}s:4:"body";s:172:"<?xml version="1.0" encoding="UTF-8"?>
-<D:response xmlns:D="DAV:">
- <D:href>http://foo.bar/~fielding_</D:href>
- <D:status>HTTP/1.1 404 Not Found</D:status>
-</D:response>
+a:2:{s:7:"headers";a:1:{i:0;s:15:"HTTP/1.1 200 OK";}s:4:"body";s:39:"<?xml
version="1.0" encoding="UTF-8"?>
";}
Modified: trunk/Webdav/tests/clients/rfc/get_resource/request/result.ser
==============================================================================
Binary files - no diff available.
Modified: trunk/Webdav/tests/clients/rfc/get_resource/response/result.ser
==============================================================================
--- trunk/Webdav/tests/clients/rfc/get_resource/response/result.ser
[iso-8859-1] (original)
+++ trunk/Webdav/tests/clients/rfc/get_resource/response/result.ser
[iso-8859-1] Mon Sep 24 14:47:45 2007
@@ -1,6 +1,1 @@
-a:2:{s:7:"headers";a:1:{i:0;s:22:"HTTP/1.1 404 Not
Found";}s:4:"body";s:183:"<?xml version="1.0" encoding="UTF-8"?>
-<D:response xmlns:D="DAV:">
- <D:href>http://foo.bar/~fielding/index.html_</D:href>
- <D:status>HTTP/1.1 404 Not Found</D:status>
-</D:response>
-";}
+a:2:{s:7:"headers";a:3:{i:0;s:15:"HTTP/1.1 200
OK";s:12:"Content-Type";s:26:"text/html;
charset="utf-8"";s:14:"Content-Length";i:49;}s:4:"body";s:48:"<html><head><title>Foo
Bar</title></head></html>";}
Modified: trunk/Webdav/tests/clients/rfc/options/request/result.ser
==============================================================================
Binary files - no diff available.
Modified: trunk/Webdav/tests/clients/rfc/options/response/result.ser
==============================================================================
--- trunk/Webdav/tests/clients/rfc/options/response/result.ser [iso-8859-1]
(original)
+++ trunk/Webdav/tests/clients/rfc/options/response/result.ser [iso-8859-1] Mon
Sep 24 14:47:45 2007
@@ -1,1 +1,1 @@
-a:2:{s:7:"headers";a:2:{i:0;s:15:"HTTP/1.1 200 OK";s:3:"DAV";s:16:"1, 2,
1#extended";}s:4:"body";N;}
+a:2:{s:7:"headers";a:2:{i:0;s:15:"HTTP/1.1 200 OK";s:3:"DAV";s:16:"1, 2,
1#extended";}s:4:"body";s:0:"";}
--
svn-components mailing list
[email protected]
http://lists.ez.no/mailman/listinfo/svn-components