File tree 6 files changed +22
-21
lines changed
6 files changed +22
-21
lines changed Original file line number Diff line number Diff line change 8
8
. Removed redundant RuntimeExceptions from Randomizer methods. The
9
9
exceptions thrown by the engines will be exposed directly. (timwolla)
10
10
11
+ - Standard:
12
+ . Fixed bug #65489 (glob() basedir check is inconsistent). (Jakub Zelenka)
13
+
11
14
04 Aug 2022, PHP 8.2.0beta2
12
15
13
16
- Core:
Original file line number Diff line number Diff line change @@ -39,6 +39,9 @@ PHP 8.2 UPGRADE NOTES
39
39
further details.
40
40
41
41
- 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.
42
45
. strtolower() and strtoupper() are no longer locale-sensitive. They now
43
46
perform ASCII case conversion, as if the locale were "C". Use
44
47
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)
471
471
if (!globbuf .gl_pathc || !globbuf .gl_pathv ) {
472
472
#ifdef GLOB_NOMATCH
473
473
no_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
- }
486
474
#endif
487
475
array_init (return_value );
488
476
return ;
Original file line number Diff line number Diff line change @@ -17,5 +17,6 @@ var_dump($a);
17
17
echo "Done \n" ;
18
18
?>
19
19
--EXPECT--
20
- bool(false)
20
+ array(0) {
21
+ }
21
22
Done
Original file line number Diff line number Diff line change 1
1
--TEST--
2
2
Test glob() function: ensure no platform difference, variation 3
3
3
--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 ' ); ?>
5
5
--FILE--
6
6
<?php
7
7
$ path = __DIR__ ;
@@ -19,10 +19,16 @@ var_dump(glob("$path/directly_not_exists"));
19
19
var_dump ($ open_basedir == ini_get ('open_basedir ' ));
20
20
?>
21
21
--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
+ }
28
34
bool(true)
Original file line number Diff line number Diff line change 1
1
--TEST--
2
2
Test glob() function: ensure no platform difference, variation 4
3
3
--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 ' ); ?>
5
5
--FILE--
6
6
<?php
7
7
$ path = __DIR__ ;
You can’t perform that action at this time.
0 commit comments