|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-09-20 07:17 UTC] iliaa@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 22:00:01 2025 UTC |
Description: ------------ pathinfo() and parse_url() doesn't handle null characters Reproduce code: --------------- /* test 1*/ var_dump(pathinfo("file.p\x00hp")); /* test 2 */ var_dump(pathinfo("fi\x00le.php")); /* test 3 */ var_dump(parse_url("./file.php")); /* test 4 */ var_dump(parse_url("./fi\x00le.php")); Expected result: ---------------- (\0 means null character) /* test 1 */ array(3) { ["dirname"]=> string(1) "." ["basename"]=> string(9) "file.p\0hp" ["extension"]=> string(4) "p\0hp" } /* test 2 */ array(3) { ["dirname"]=> string(1) "." ["basename"]=> string(9) "fi\0le.php" ["extension"]=> string(4) "php" } /* test 3 */ array(1) { ["path"]=> string(10) "./file.php" } /* test 4 */ array(1) { ["path"]=> string(10) "./fi\0le.php" } Actual result: -------------- /* test 1 */ => OK /* test 2 */ array(3) { ["dirname"]=> string(1) "." ["basename"]=> string(9) "fi\0le.php" } Extension should be "php". /* test 3 */ => OK /* test 4 */ array(1) { ["path"]=> string(10) "./fi" }