#41527 [Opn->Asn]: WDDX deserialize numeric string array key bugs
| From: | tony2001@php.net | Date: | Tue, 29 May 2007 09:31:48 +0000 |
| Subject: | #41527 [Opn->Asn]: WDDX deserialize numeric string array key bugs | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-113147@lists.php.net to get a copy of this message | ||
ID: 41527
Updated by: tony2001@php.net
Reported By: php_lists at realplain dot com
-Status: Open
+Status: Assigned
Bug Type: WDDX related
PHP Version: 5.2.3RC1
-Assigned To:
+Assigned To: iliaa
Previous Comments:
------------------------------------------------------------------------
[2007-05-29 09:07:00] php_lists at realplain dot com
Description:
------------
I sent a couple messages to the Internals mailing list over the last
few weeks with a better fix for Bug #41283
(http://news.php.net/php.internals/29315), but they seem to have been
ignored, so I'm opening this bug (and I discovered wrong changes in the
4.4 branch that should be fixed).
As seen with the "Reproduce code," all branches are mishandling those
types of numeric keys. They worked fine up to 4.4.0, I believe, until
Bug #34068 was "fixed" there (it actually never existed in 4.x as there
wasn't a change of the internal functions there). (That bogus 4.x change
then caused Bug #35410, #41283 (not fixed in 4.x), etc.)
Just trying to prevent more future problems like Bug #38464 I created
for array_count_values() (caused by the same internal change), where
individual bugs get reported/fixed, instead of fixing the root cause.
:-)
Here are patches to fix these bugs in each branch:
http://realplain.com/php/wddx_num_key.diff
http://realplain.com/php/wddx_num_key_5_2.diff
http://realplain.com/php/wddx_num_key_4_4.diff
Reproduce code:
---------------
<?php
$data = array('01' => 'Zero', '+1' => 'Plus sign',
' 1' => 'Space');
var_dump(wddx_deserialize(wddx_serialize_vars('data')));
Expected result:
----------------
array(3) {
["01"]=>
string(4) "Zero"
["+1"]=>
string(9) "Plus sign"
[" 1"]=>
string(5) "Space"
}
Actual result:
--------------
array(1) {
["data"]=>
array(1) {
[1]=>
string(5) "Space"
}
}
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=41527&edit=1