]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #28668 (glob() does not work with relative paths on Windows)
authorIlia Alshanetsky <iliaa@php.net>
Mon, 7 Jun 2004 18:31:15 +0000 (18:31 +0000)
committerIlia Alshanetsky <iliaa@php.net>
Mon, 7 Jun 2004 18:31:15 +0000 (18:31 +0000)
NEWS
ext/standard/dir.c

diff --git a/NEWS b/NEWS
index 5a8ca87f397617faba01b6dff252e69a4492efca..edd8526bc10f0e614c97fc9ffccbb083efafd1d2 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP 4                                                                      NEWS
 ?? ??? 2004, Version 4.3.8
 - Fixed bug #28670 (WWW-Authentication header mangling with PCRE in safe_mode
   adds extra spaces). (Ilia)
+- Fixed bug #28668 (glob() does not work with relative paths on Windows).
+  (Ilia)
 - Fixed bug #28649 (Proper glob() return value on Linux when there are no
   matches). (Ilia)
 - Fixed bug #28632 (Prevent open_basedir bypass via MySQL's LOAD DATA LOCAL).
index 7e5c4a0d0c618a24790efce565c144c2d48b7957..f40f3d64a0e24b35173404ccdccf64d13084a5c1 100644 (file)
@@ -371,13 +371,12 @@ PHP_FUNCTION(glob)
                        cwd[0] = '\0';
                }
 #ifdef PHP_WIN32
-               if (!IS_SLASH(cwd[0])) {
+               if (IS_SLASH(*pattern)) {
                        cwd[2] = '\0';
-                       cwd_skip = 3;
                }
-#else
-               cwd_skip = strlen(cwd)+1;
 #endif
+               cwd_skip = strlen(cwd)+1;
+
                snprintf(work_pattern, MAXPATHLEN, "%s%c%s", cwd, DEFAULT_SLASH, pattern);
                pattern = work_pattern;
        }