com php-src: Fix bug #68335: rmdir doesnt work with file:// stream wrapper: main/streams/plain_wrapper.c
| From: | Stanislav Malyshev | Date: | Sat, 01 Nov 2014 03:32:18 +0000 |
| Subject: | com php-src: Fix bug #68335: rmdir doesnt work with file:// stream wrapper: main/streams/plain_wrapper.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-83403@lists.php.net to get a copy of this message | ||
Commit: de4638d3fdae935c0d25343e77b8d809f156391c
Author: mcq8 <php@mcq8.be> Sat, 1 Nov 2014 04:32:18 +0100
Parents: e2305ac27e5130e8ff84df69847780c50ee59f1d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=de4638d3fdae935c0d25343e77b8d809f156391c
Log:
Fix bug #68335: rmdir doesnt work with file:// stream wrapper
Bugs:
https://bugs.php.net/68335
Changed paths:
M main/streams/plain_wrapper.c
Diff:
diff --git a/main/streams/plain_wrapper.c b/main/streams/plain_wrapper.c
index 1aa01f2..ed50d8c 100644
--- a/main/streams/plain_wrapper.c
+++ b/main/streams/plain_wrapper.c
@@ -1272,6 +1272,13 @@ static int php_plain_files_mkdir(php_stream_wrapper *wrapper, const char
*dir, i
static int php_plain_files_rmdir(php_stream_wrapper *wrapper, const 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 = (int)strlen(url);
#endif