]> granicus.if.org Git - php/commitdiff
Fix bug #68335: rmdir doesnt work with file:// stream wrapper
authormcq8 <php@mcq8.be>
Sat, 1 Nov 2014 03:32:18 +0000 (04:32 +0100)
committerStanislav Malyshev <stas@php.net>
Mon, 1 Dec 2014 00:38:13 +0000 (16:38 -0800)
main/streams/plain_wrapper.c

index 4b5dc55276f470c4dce6718794e40f1ddff4055a..bba22b14dc053da3dbd33bbc8fcd2caa3af060aa 100644 (file)
@@ -1267,6 +1267,13 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, char *dir, int mod
 
 static int php_plain_files_rmdir(php_stream_wrapper *wrapper, char *url, int options, php_stream_context *context TSRMLS_DC)
 {
+       char *p;
+       if ((p = strstr(url, "://")) != NULL) {
+               if (p < strchr(url, '/')) {
+                       url = p + 3;
+               }
+       }
+
 #if PHP_WIN32
        int url_len = strlen(url);
 #endif