PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » HTTP » HTTP_WebDAV_Server » Bug #1949

$_prop_encoding not used for $file['path']

Details

Submitted2004-07-22 12:37 UTC
Frompear dot php dot net at chsc dot dk
Assignedhholzgra
StatusClosed
PackageHTTP_WebDAV_Server
PHP Version5.0.0
OSLinux
Roadmaps1.0

Comments

[2004-07-22 12:37 UTC] pear dot php dot net at chsc dot dk

Description:
------------
Using Microsoft-WebDAV-MiniRedir/5.1.2600 on Windows XP I cannot get a directory listing of a directory that contains files or directories with non-us-ascii characters in their name, when $server->_prop_encoding is different from "utf-8". Instead I get a generic error dialog saying something like "Invalid parameter".

If I make the following change to Server.php around line 606, it works for me:

- $href = $_SERVER['SCRIPT_NAME'] . $path;
+ $href = $_SERVER['SCRIPT_NAME'] . $this->_prop_encode($path);

Without the change, $path is encoded according to the encoding specified by the user in $server->_prop_encoding. With the change, the non-us-ascii characters are UTF-8-encoded.

I don't know whether this is the right way to fix the problem - my understanding of the code is not that big.

[2004-10-05 16:20 UTC] pear dot php dot net at chsc dot dk

I looks as if $href should also be encoded using $this->_urlencode(). Otherwise there are problems when a filename contains an ampersand.

[2005-09-07 08:58 UTC] pear dot php dot net at chsc dot dk

This problem still exists in the latest CVS version.

Changing line 635 from

$href = $this->_slashify($_SERVER['SCRIPT_NAME']) . $path;

to

$href = $this->_prop_encode($this->_slashify($_SERVER['SCRIPT_NAME']) . $path);

appearently fixes the problem.

[2005-09-07 09:18 UTC] pear dot php dot net at chsc dot dk

Sorry, that should be

$href = $this->_urlencode($this->_prop_encode($this->_slashify($_SERVER['SCRIPT_NAME']) . $path));

in order to also work with e.g. ampersands in filenames.