Edit report at https://bugs.php.net/bug.php?id=60569&edit=1

 ID:                 60569
 User updated by:    hanskrentel at yahoo dot de
 Reported by:        hanskrentel at yahoo dot de
 Summary:            Nullbyte truncates Exception $message.
-Status:             Closed
+Status:             Assigned
 Type:               Bug
 Package:            Scripting Engine problem
 Operating System:   Fedora 14
 PHP Version:        5.3.8
 Assigned To:        iliaa
 Block user comment: N
 Private report:     N

 New Comment:

Re-open because it is not fixed.


Previous Comments:
------------------------------------------------------------------------
[2012-03-14 10:52:47] hanskrentel at yahoo dot de

Tested against PHP trunk Revision: 324199 (Windows), there still is truncation 
on 
the NULL char.

$original = "Null Char \0 Test.";
echo "Original Message..: ", $original, "\n";
$e = new Exception($original);
$processed = $e->getMessage();
echo "Processed Message.: ", $processed, "\n";

------------------------------------------------------------------------
[2012-03-11 18:15:12] il...@php.net

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.



------------------------------------------------------------------------
[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

Reply via email to