From: Pierre Joye Date: Tue, 8 Jan 2013 14:02:04 +0000 (+0100) Subject: - fix bug #47358, glob returns error, should be empty array() X-Git-Tag: php-5.4.33RC1~29 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=481c4715d4f4c77293d65216324215f671954660;p=php - fix bug #47358, glob returns error, should be empty array() Conflicts: ext/standard/dir.c --- diff --git a/NEWS b/NEWS index 2429492cc6..a34ea04b3a 100644 --- 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). diff --git a/ext/standard/dir.c b/ext/standard/dir.c index c6d6ddd263..f39789a5c9 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -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; } } diff --git a/ext/standard/tests/file/glob_variation3.phpt b/ext/standard/tests/file/glob_variation3.phpt index 9e1e28baf9..4f504e668c 100644 --- a/ext/standard/tests/file/glob_variation3.phpt +++ b/ext/standard/tests/file/glob_variation3.phpt @@ -15,5 +15,6 @@ var_dump(glob("$path/*.none")); --EXPECT-- array(0) { } -bool(false) +array(0) { +} ==DONE==