Home » HTTP » HTTP_WebDAV_Server » Bug #5368
Double slashes in PROPFIND response
Details
| Submitted | 2005-09-12 13:05 UTC |
|---|---|
| From | pear dot php dot net at chsc dot dk |
| Assigned | hholzgra |
| Status | Closed |
| Package | HTTP_WebDAV_Server |
| PHP Version | 5.0.4 |
| OS | Linux |
| Roadmaps | (Not assigned) |
Comments
[2005-09-12 13:05 UTC] pear dot php dot net at chsc dot dk
Description:
------------
The PROPFIND response contains entries with two slashes in a row like this:
<D:href>/webdav.php//foo/bar</D:href>
This confuses the Microsoft Data Access Internet Publishing Provider DAV 1.1 client and makes the folder itself appear in listings.
This is caused by the following line (line 634 in http_PROPFIND()):
$href = $this->_urlencode($this->_prop_encode($this->_slashify($_SERVER['SCRIPT_NAME']) . $path));
slashify() always returns a string ending in a /, and $path always starts with a / (at least it does in the Filesystem implementation - I assume this is the right behaviour?), so the resulting string always contains two slashes in a row.
If the subclass instead returns paths, that never start with a slash, there is another problem. The root folder would then have the name "" and would thus be omitted by if-condition a few lines further up.