php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50085 exception message does not allow hex 0
Submitted: 2009-11-05 01:20 UTC Modified: 2010-10-23 16:45 UTC
From: andreas dot spreiter at gmx dot net Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.0 OS: *
Private report: No CVE-ID: None
 [2009-11-05 01:20 UTC] 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   ? &#65533; message
Some error   ? &#65533; message

Actual result:
--------------
Some error   ? 
Some error   ? &#65533; message

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-05 14:36 UTC] kalle@php.net
Assigned to self, below patch fixes the problem:
http://www.pastie.org/684799
 [2010-10-23 16:45 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&amp;revision=304663
Log: Fixed bug #50085 (exception message does not allow hex 0)
 [2010-10-23 16:45 UTC] kalle@php.net
-Status: Assigned +Status: Closed -Type: Bug +Type: Documentation Problem -Package: Scripting Engine problem +Package: Documentation problem
 [2010-10-23 16:45 UTC] kalle@php.net
Re-classified as a documentation issue and fixed accordingly
 [2020-02-07 06:08 UTC] phpdocbot@php.net
Automatic comment on behalf of kalle
Revision: http://git.php.net/?p=doc/en.git;a=commit;h=739b47be953e2edd69e3bbadb306de5b36be1a6b
Log: Fixed bug #50085 (exception message does not allow hex 0)
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Jun 01 20:01:24 2020 UTC