File tree Expand file tree Collapse file tree 6 files changed +22
-21
lines changed
Expand file tree Collapse file tree 6 files changed +22
-21
lines changed Original file line number Diff line number Diff line change 88 . Removed redundant RuntimeExceptions from Randomizer methods. The
99 exceptions thrown by the engines will be exposed directly. (timwolla)
1010
11+ - Standard:
12+ . Fixed bug #65489 (glob() basedir check is inconsistent). (Jakub Zelenka)
13+
111404 Aug 2022, PHP 8.2.0beta2
1215
1316- Core:
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ PHP 8.2 UPGRADE NOTES
3939 further details.
4040
4141- Standard:
42+ . glob() returns empty array if all paths are restricted by open_basedir.
43+ Previously the error was returned but that behavior was not consistent and
44+ did not work correctly for all patterns.
4245 . strtolower() and strtoupper() are no longer locale-sensitive. They now
4346 perform ASCII case conversion, as if the locale were "C". Use
4447 mb_strtolower() if you want localized case conversion. Similarly, stristr,
Original file line number Diff line number Diff line change @@ -471,18 +471,6 @@ PHP_FUNCTION(glob)
471471 if (!globbuf .gl_pathc || !globbuf .gl_pathv ) {
472472#ifdef GLOB_NOMATCH
473473no_results :
474- #endif
475- #ifndef PHP_WIN32
476- /* Paths containing '*', '?' and some other chars are
477- illegal on Windows but legit on other platforms. For
478- this reason the direct basedir check against the glob
479- query is senseless on windows. For instance while *.txt
480- is a pretty valid filename on EXT3, it's invalid on NTFS. */
481- if (PG (open_basedir ) && * PG (open_basedir )) {
482- if (php_check_open_basedir_ex (pattern , 0 )) {
483- RETURN_FALSE ;
484- }
485- }
486474#endif
487475 array_init (return_value );
488476 return ;
Original file line number Diff line number Diff line change @@ -17,5 +17,6 @@ var_dump($a);
1717echo "Done \n" ;
1818?>
1919--EXPECT--
20- bool(false)
20+ array(0) {
21+ }
2122Done
Original file line number Diff line number Diff line change 11--TEST--
22Test glob() function: ensure no platform difference, variation 3
33--SKIPIF--
4- <?php if ( substr (PHP_OS , 0 , 3 ) == "WIN " ) { die ('skip not valid on Windows ' );} ?>
4+ <?php if ( substr (PHP_OS , 0 , 3 ) == "WIN " ) die ('skip not valid directory on Windows ' ); ?>
55--FILE--
66<?php
77$ path = __DIR__ ;
@@ -19,10 +19,16 @@ var_dump(glob("$path/directly_not_exists"));
1919var_dump ($ open_basedir == ini_get ('open_basedir ' ));
2020?>
2121--EXPECT--
22- bool(false)
23- bool(false)
24- bool(false)
25- bool(false)
26- bool(false)
27- bool(false)
22+ array(0) {
23+ }
24+ array(0) {
25+ }
26+ array(0) {
27+ }
28+ array(0) {
29+ }
30+ array(0) {
31+ }
32+ array(0) {
33+ }
2834bool(true)
Original file line number Diff line number Diff line change 11--TEST--
22Test glob() function: ensure no platform difference, variation 4
33--SKIPIF--
4- <?php if ( substr (PHP_OS , 0 , 3 ) != "WIN " ) { die ('skip only valid on Windows ' );} ?>
4+ <?php if ( substr (PHP_OS , 0 , 3 ) != "WIN " ) die ('skip only valid directory on Windows ' ); ?>
55--FILE--
66<?php
77$ path = __DIR__ ;
You can’t perform that action at this time.
0 commit comments