From: bilge at scriptfusion dot com Operating system: Linux PHP version: 5.5.3 Package: Streams related Bug Type: Bug Bug description:Stream path cannot contail null char (chr(0))
Description: ------------ Stream path can contain any character, whether URL encoded or not, except for the null character. Including a null character in the path raises the following error: file_get_contents() expects parameter 1 to be a valid path, string given Both the use case and test suite to support the claims above can be found at https://github.com/Bilge/VerbatimStream/tree/eb185806f9bea3ee65b7d0f3e42dcd27a7b40614 The use case is a custom stream wrapper that takes the path and converts it into a read-only data stream. The current workaround is to urlencode any path that contains nulls. However, this approach provides little benefit over the data wrapper. Being able to include nulls directly in the path would eliminate unnecessary url encoding and decoding in the custom wrapper implementation. Test script: --------------- file_get_contents("\000"); //or file_get_contents("verbatim://\000"); Expected result: ---------------- No error. Actual result: -------------- file_get_contents() expects parameter 1 to be a valid path, string given -- Edit bug report at https://bugs.php.net/bug.php?id=65636&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=65636&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=65636&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=65636&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=65636&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=65636&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=65636&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=65636&r=needscript Try newer version: https://bugs.php.net/fix.php?id=65636&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=65636&r=support Expected behavior: https://bugs.php.net/fix.php?id=65636&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=65636&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=65636&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=65636&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=65636&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=65636&r=dst IIS Stability: https://bugs.php.net/fix.php?id=65636&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=65636&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=65636&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=65636&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=65636&r=mysqlcfg