WDDX deserialize array key bug
| Bug #41283 | WDDX deserialize array key bug | |||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Submitted: | 2007-05-04 14:37 UTC | Modified: | 2007-05-05 15:15 UTC |
|
||||||||||
| From: | php dot net at trueprices dot net | Assigned: | ||||||||||||
| Status: | Closed | Package: | WDDX related | |||||||||||
| PHP Version: | 5.2.2 | OS: | Debian | |||||||||||
| Private report: | No | CVE-ID: | None | |||||||||||
[2007-05-04 14:37 UTC] php dot net at trueprices dot net
Description:
------------
wddx_deserialize/wddx_unserialize does not deserialize the array keys correctly
Array with the following keys will not deserialize correctly in PHP 5.2.1 & 5.2.2 but did deserialize correctly in PHP4
array('1.1' => 'One 1','1.2' => 'One 2')
array keys will become 1 and therefor the 2nd key 1.2 will overwrite the first key 1.1
Reproduce code:
---------------
<?php
$data = array(
'somearray' => array('1.1' => 'One 1','1.2' => 'One 2')
);
echo "<pre>Should be:\n";
var_dump(array('data'=>$data));
echo '</pre>';
echo "<pre>Is:\n";
var_dump(wddx_deserialize(wddx_serialize_vars('data')));
echo '</pre>';
?>
Expected result:
----------------
array(1) {
["data"]=>
array(1) {
["somearray"]=>
array(2) {
["1.1"]=>
string(5) "One 1"
["1.2"]=>
string(5) "One 2"
}
}
}
Actual result:
--------------
array(1) {
["data"]=>
array(1) {
["somearray"]=>
array(1) {
[1]=>
string(5) "One 2"
}
}
}
Patches
Pull Requests
History
AllCommentsChangesGit/SVN commits
[2007-05-05 15:15 UTC] iliaa@php.net