- fix bug #47358, glob returns error, should be empty array()
authorPierre Joye <pierre.php@gmail.com>
Tue, 8 Jan 2013 14:02:04 +0000 (15:02 +0100)
committerStanislav Malyshev <stas@php.net>
Thu, 14 Aug 2014 23:56:22 +0000 (16:56 -0700)
Conflicts:
ext/standard/dir.c

NEWS
ext/standard/dir.c
ext/standard/tests/file/glob_variation3.phpt

diff --git a/NEWS b/NEWS
index 2429492cc6069fceb3762bae2aed3d9a0229ea15..a34ea04b3aebac2d0699ab8c71532dbc7c47ab8e 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,9 @@ PHP                                                                        NEWS
 |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 ?? ??? 2014, PHP 5.4.33
 
+- Core:
+  . Fixed bug #47358 (glob returns error, should be empty array()). (Pierre)
+
 - OpenSSL:
   . Fixed bug #41631 (socket timeouts not honored in blocking SSL reads)
     (Daniel Lowrey).
index c6d6ddd26336c9185ad21201d60585bd7e673298..f39789a5c9b4da02367c49cf96863d2c5d6c01ff 100644 (file)
@@ -492,9 +492,7 @@ PHP_FUNCTION(glob)
        if (!globbuf.gl_pathc || !globbuf.gl_pathv) {
 no_results:
                if (PG(open_basedir) && *PG(open_basedir)) {
-                       struct stat s;
-
-                       if (0 != VCWD_STAT(pattern, &s) || S_IFDIR != (s.st_mode & S_IFMT)) {
+                       if (php_check_open_basedir_ex(pattern, 0 TSRMLS_CC)) {
                                RETURN_FALSE;
                        }
                }
index 9e1e28baf925af081b9423a97e4e695f16de97f9..4f504e668c55c18ed223ccc092b74e56ea7d4711 100644 (file)
@@ -15,5 +15,6 @@ var_dump(glob("$path/*.none"));
 --EXPECT--
 array(0) {
 }
-bool(false)
+array(0) {
+}
 ==DONE==