Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.0.0RC8

Bug #1949 $_prop_encoding not used for $file['path']
Submitted: 2004-07-22 07:37 UTC Modified: 2008-03-29 17:37 UTC
From: pear dot php dot net at chsc dot dk Assigned: hholzgra
Status: Closed Package: HTTP_WebDAV_Server
PHP Version: 5.0.0 OS: Linux
Roadmaps: 1.0    
Subscription  


 [2004-07-22 07: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.

Comments

 [2004-10-05 11: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 03: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 04: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.
 [2007-12-03 10:05 UTC] thesaur (Klaus Guenther)
This looks like it's line 716 now. Any chance that it could get fixed? Compare with line 861 (current CVS). Should be an easy fix.
 [2008-03-29 17:37 UTC] hholzgra (Hartmut Holzgraefe)
This bug has been fixed in CVS. If this was a documentation problem, the fix will appear on pear.php.net by the end of next Sunday (CET). If this was a problem with the pear.php.net website, the change should be live shortly. Otherwise, the fix will appear in the package's next release. Thank you for the report and for helping us make PEAR better.