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

Bug #10238 DELETE method in Filesystem.php breaks when path contains space character
Submitted: 2007-03-01 21:42 UTC
From: sneedsquatch at hotmail dot com Assigned: hholzgra
Status: Closed Package: HTTP_WebDAV_Server (version 1.0.0RC4)
PHP Version: 5.2.0 OS: debian linux (unstable)
Roadmaps: 1.0    
Subscription  


 [2007-03-01 21:42 UTC] sneedsquatch at hotmail dot com (Sneed Mcgee)
Description: ------------ If using the supplied Filesystem.php script to implement a server, attempts to delete directories containing space characters will fail. I was able to fix this by changing line 493 from: System::rm("-rf $path"); to System::rm(array("-rf", $path)); I have also supplied the code necessary to report the error to the client. This may or may not be per WebDAV standards as I was unable to verify if 500 is the correct way to handle this. I can say that the MS client understood this response gracefully. I realize Filesystem.php is sample code. However if there are others like me out there with limited knowledge of how to implement a server, almost all of this file's code is utilized to get a working server. Test script: --------------- <replaces lines 489-496> if (is_dir($path)) { if (!System::rm(array("-rf", $path))) { return "500 Internal server error"; } $query = "DELETE FROM {$this->db_prefix}properties WHERE path LIKE '".$this->_slashify($options["path"])."%'"; mysql_query($query); } else { if (!unlink ($path)) { return "500 Internal server error"; } } Expected result: ---------------- When a client tries to delete a directory containing space characters, it should be deleted. If it cannot be deleted (for any reason) the client should be informed of this. Actual result: -------------- Directories containing spaces are not deleted. For example, after a performing a delete command using the MS client, the directory disappears as though it has been deleted. I'm guessing this is because the server does not inform the client of any problem. After performing a manual refresh, the directory will show up again.

Comments

 [2007-08-19 18:18 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.