Edit report at https://bugs.php.net/bug.php?id=60569&edit=1
ID: 60569 Updated by: il...@php.net Reported by: hanskrentel at yahoo dot de Summary: Nullbyte truncates Exception $message. -Status: Open +Status: Closed Type: Bug Package: Scripting Engine problem Operating System: Fedora 14 PHP Version: 5.3.8 -Assigned To: +Assigned To: iliaa Block user comment: N Private report: N New Comment: This bug has been fixed in SVN. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. Previous Comments: ------------------------------------------------------------------------ [2012-03-11 18:15:03] il...@php.net Automatic comment from SVN on behalf of iliaa Revision: http://svn.php.net/viewvc/?view=revision&revision=324112 Log: Fixed bug #60569 (Nullbyte truncates Exception $message). ------------------------------------------------------------------------ [2011-12-20 04:17:32] hanskrentel at yahoo dot de Description: ------------ When an Exception class is instantiated and a string contain a nullbyte character ("\0") is used as $message, Exception::getMessage() returns a truncated string (the protected member Exception::$message is truncated as well). Looks like a duplicate of https://bugs.php.net/bug.php?id=50085 which outlined this as documentation problem. No idea why this is a documentation problem. Test script: --------------- $e = new Exception("test\0me"); echo $e->getMessage(); Expected result: ---------------- output (not displaying non-printable characters): testme Actual result: -------------- output (not displaying non-printable characters): test ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=60569&edit=1