#50085 [Opn->Asn]: exception message does not allow hex 0
| From: | kalle@php.net | Date: | Thu, 05 Nov 2009 14:36:11 +0000 |
| Subject: | #50085 [Opn->Asn]: exception message does not allow hex 0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-144292@lists.php.net to get a copy of this message | ||
ID: 50085
Updated by: kalle@php.net
Reported By: andreas dot spreiter at gmx dot net
-Status: Open
+Status: Assigned
-Bug Type: SPL related
+Bug Type: Scripting Engine problem
-Operating System: Windows XP
+Operating System: *
PHP Version: 5.3.0
-Assigned To:
+Assigned To: kalle
New Comment:
Assigned to self, below patch fixes the problem:
http://www.pastie.org/684799
Previous Comments:
------------------------------------------------------------------------
[2009-11-05 01:20:31] andreas dot spreiter at gmx dot net
Description:
------------
it seems that the exception message must not contain the hex 0
character like "\x00" i.e. message is truncated at first occurence of
hex 0
Reproduce code:
---------------
try {
$msg = "Some error \x13 \x01 \xff \x00 message";
throw new Exception($msg);
} catch(Exception $e) {
echo '<pre>';
echo $e->getMessage()."\n";
echo $msg;
echo '</pre>';
}
Expected result:
----------------
Some error ÿ � message
Some error ÿ � message
Actual result:
--------------
Some error ÿ
Some error ÿ � message
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=50085&edit=1