diff options
Diffstat (limited to 'ext/standard/dir.c')
| -rw-r--r-- | ext/standard/dir.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/ext/standard/dir.c b/ext/standard/dir.c index ef28e9feaf..ca7e576c92 100644 --- a/ext/standard/dir.c +++ b/ext/standard/dir.c @@ -491,13 +491,18 @@ PHP_FUNCTION(glob) /* now catch the FreeBSD style of "no matches" */ if (!globbuf.gl_pathc || !globbuf.gl_pathv) { no_results: +#ifndef PHP_WIN32 + /* Paths containing '*', '?' and some other chars are + illegal on Windows but legit on other platforms. For + this reason the direct basedir check against the glob + query is senseless on windows. For instance while *.txt + is a pretty valid filename on EXT3, it's invalid on NTFS. */ 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; } } +#endif array_init(return_value); return; } |
