File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -3527,6 +3527,10 @@ PHP_METHOD(Phar, offsetExists)
3527
3527
}
3528
3528
RETURN_TRUE ;
3529
3529
} else {
3530
+ /* If the info class is not based on PharFileInfo, directories are not directly instantiable */
3531
+ if (UNEXPECTED (!instanceof_function (phar_obj -> spl .info_class , phar_ce_entry ))) {
3532
+ RETURN_FALSE ;
3533
+ }
3530
3534
if (zend_hash_str_exists (& phar_obj -> archive -> virtual_dirs , fname , (uint32_t ) fname_len )) {
3531
3535
RETURN_TRUE ;
3532
3536
}
Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ __halt_compiler();
43
43
bool(true)
44
44
object(PharFileInfo)#%d (2) {
45
45
["pathName":"SplFileInfo":private]=>
46
- string(%s ) "phar:/ //%s/phar_oo_011.phar.php/hi"
46
+ string(%d ) "phar://%s/phar_oo_011.phar.php/hi"
47
47
["fileName":"SplFileInfo":private]=>
48
48
string(2) "hi"
49
49
}
50
50
bool(true)
51
- phar:/// %s/phar_oo_011.phar.php/hi/f.php
52
- bool(true )
51
+ phar://%s/phar_oo_011.phar.php/hi/f.php
52
+ bool(false )
53
53
LogicException: Cannot use SplFileObject with directories
54
54
bool(true)
55
55
hi
You can’t perform that action at this time.
0 commit comments