bug39863.phpt 424 B

1234567891011121314151617181920212223
  1. --TEST--
  2. Bug #39863 (file_exists() silently truncates after a null byte)
  3. --CREDITS--
  4. Andrew van der Stock, vanderaj @ owasp.org
  5. --FILE--
  6. <?php
  7. $filename = __FILE__ . chr(0). ".ridiculous";
  8. if (file_exists($filename)) {
  9. echo "FAIL\n";
  10. }
  11. else {
  12. echo "PASS\n";
  13. }
  14. ?>
  15. ===DONE===
  16. <?php exit(0); ?>
  17. --EXPECTF--
  18. Warning: file_exists() expects parameter 1 to be a valid path, string given in %s on line %d
  19. PASS
  20. ===DONE===