|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-01-31 09:30 UTC] mails at thomasbley dot de
Description:
------------
Accessing undefined object members gives a wrong notice message if the member contains a zero byte. The problem occurs in real code when request parameters are put as members in controller or request objects.
Test script:
---------------
<?php
ini_set('error_reporting', E_ALL);
ini_set('display_errors', 1);
$obj = new stdclass();
echo $obj->{"foo\0bar"};
$obj->{"foo\0bar"} = 1;
echo $obj->{"foo\0bar"};
Expected result:
----------------
sapi/cli/php /tmp/test.php
Notice: Undefined property: stdClass::$foobar in /tmp/test.php on line 6
1
Actual result:
--------------
sapi/cli/php /tmp/test.php
Notice: Undefined property: stdClass::$foo in /tmp/test.php on line 6
1
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 30 20:00:01 2025 UTC |
This is for all error messages, e.g.: trigger_error("foo\0bar");