]> granicus.if.org Git - php/commitdiff
New test for file_exists (bug #39863). It currently xfail's
authorChristopher Jones <sixd@php.net>
Sat, 5 Jun 2010 19:44:48 +0000 (19:44 +0000)
committerChristopher Jones <sixd@php.net>
Sat, 5 Jun 2010 19:44:48 +0000 (19:44 +0000)
ext/standard/tests/file/bug39863.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/file/bug39863.phpt b/ext/standard/tests/file/bug39863.phpt
new file mode 100644 (file)
index 0000000..520a464
--- /dev/null
@@ -0,0 +1,24 @@
+--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); ?>
+--XFAIL--
+Needs bug #39863 fixed
+--EXPECT--
+PASS
+===DONE===
+