Skip to content

Commit cb73872

Browse files
bishopbnikic
authored andcommitted
Add test for bug #66960
1 parent 3eaab04 commit cb73872

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

ext/phar/tests/bug66960.phpt

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
--TEST--
2+
Bug #66960 phar long filename crash
3+
--SKIPIF--
4+
<?php if (!extension_loaded("phar")) die("skip"); ?>
5+
--INI--
6+
phar.readonly = 0
7+
memory_limit = -1
8+
--FILE--
9+
<?php
10+
$file = __DIR__ . DIRECTORY_SEPARATOR . 'bug66960.phar';
11+
$phar = new Phar($file);
12+
var_dump(file_exists("phar://$file/". str_repeat('a', PHP_MAXPATHLEN-1)));
13+
var_dump(file_exists("phar://$file/". str_repeat('a', PHP_MAXPATHLEN)));
14+
var_dump(file_exists("phar://$file/". str_repeat('a', PHP_MAXPATHLEN+1)));
15+
echo 'done';
16+
?>
17+
--CLEAN--
18+
$file = __DIR__ . DIRECTORY_SEPARATOR . 'bug66960.phar';
19+
unlink($file);
20+
--EXPECT--
21+
bool(false)
22+
bool(false)
23+
bool(false)
24+
done

0 commit comments

Comments
 (0)