summaryrefslogtreecommitdiff
path: root/ext/standard/tests/file/bug39863.phpt
blob: 5e26b5a6361f1b9e76c17a2d87406d245730bd6d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
--TEST--
Bug #39863 (file_exists() silently truncates after a null byte)
--CREDITS--
Andrew van der Stock, vanderaj @ owasp.org
--FILE--
<?php

$filename = __FILE__ . chr(0). ".ridiculous";

if (file_exists($filename)) {
    echo "FAIL\n";
}
else {
    echo "PASS\n";
}
?>
===DONE===
<?php exit(0); ?>
--EXPECTF--
Warning: file_exists() expects parameter 1 to be a valid path, string given in %s on line %d
PASS
===DONE===