[Bug 310845] Re: php5 serialize() function corrupt strings

sir_gon gnzsquall at gmail.com
Tue Dec 23 23:04:49 GMT 2008


OK, adding this lines, I got this output:

///////////////////////////////////////////
object(Something)[1]
  public 'a' => string '123' (length=3)
  protected 'b' => string 'abc' (length=3)
  private 'c' => string 'xyz' (length=3)

string
'O:9:"Something":3:{s:1:"a";s:3:"123";s:4:"�*�b";s:3:"abc";s:12:"�Something�c";s:3:"xyz";}'
(length=89)

object(Something)[2]
  public 'a' => string '123' (length=3)
  protected 'b' => string 'abc' (length=3)
  private 'c' => string 'xyz' (length=3)
///////////////////////////////////////////

Unserialize process doesn't fail. Only serialized string has wrong characters.
	
The problem is that I'm working on an algorithm, which requires making hashing serialized in the chain with the data stored externally (cookies, database, files, ...). By comparing the hash to the server with the problem, with the hash stored in external storage, do not match.

Testing the same algorithm on another server with the same version of
PHP, produces no fault and get the desired result.

I also tried to install packages php, reconstructed with the command:

apt-get source -b libapache2-mod-php5

But given the same result.

Another info: 	
If the serialized string is passed to other functions (such as encrypt and decrypt with mcrypt), apparently the string is "clean" of these strange characters.

PS: 2 friends with Ubuntu 8.10 have confirmed the fail.

-- 
php5 serialize() function corrupt strings
https://bugs.launchpad.net/bugs/310845
You received this bug notification because you are a member of Ubuntu
Server Team, which is subscribed to php5 in ubuntu.



More information about the Ubuntu-server-bugs mailing list