Skip Menu |

This queue is for tickets about the PHP-Serialization CPAN distribution.

Report information
The Basics
Id: 21218
Status: resolved
Priority: 0/
Queue: PHP-Serialization

People
Owner: bobtfish [...] bobtfish.net
Requestors: b888.2000 [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Critical
Broken in:
  • 0.25
  • 0.27
  • 0.28
  • 0.29
Fixed in: (no value)



perl, v5.6.2 built for i686-linux-thread-multi PHP-Serialization-0.27 Linux pc.local 2.6.12-2.3aspsmp #1 SMP Tue Mar 21 15:58:06 EST 2006 i686 i686 i386 GNU/Linux There are problems with unserialize hashes with numeric keys. For example in php serializing following array array( 'lll' => array( '195' => array(111, 'bbb'), '194' => array(222, 'ccc'), ) ); makes a:1:{s:3:"lll";a:2:{i:195;a:2:{i:0;i:111;i:1;s:3:"bbb";}i:194;a:2:{i:0;i:222;i:1;s:3:"ccc";}}} but unserialize in perl gets totally different result 'lll' => [ [ 111, 'bbb' ], [ 222, 'ccc' ] ]
For now, i see the only way to fix it - always parse array as hash. Patch attached.
216c216 < if ( $values[$_] !~ /^\d+$/ ) { --- > # if ( $values[$_] !~ /^\d+$/ ) { 219c219 < } --- > # }
Fixed in the just shipped 0.32