php-src/ext/standard/tests/file/bug39863.phpt

24 lines
422 B
Plaintext
Raw Normal View History

--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); ?>
2011-06-06 22:36:54 +00:00
--EXPECTF--
Warning: file_exists() expects parameter 1 to be valid path, string given in %s on line %d
PASS
===DONE===