From: nir at winpdb dot org
Operating system: Ubuntu Intrepid
PHP version: 5.2.8
PHP Bug Type: *General Issues
Bug description: serialize() of a string with a line break (\r) broken.
Description:
------------
Isn't this a bug?
php > print serialize("hi\rho");
ho";"hi
php > print unserialize(serialize("hi\rho"));
ho
I stumbled on this while working on a Drupal system. Can this possibly
have security consequences as well? if a \r on a web form breaks the
internal data structures of a system?
Am I missing anything?
PS: I am actually using PHP 5.2.6 on Ubuntu Intrepid.
Cheers,
Nir
Reproduce code:
---------------
print serialize("hi\rho");
Expected result:
----------------
s:5:"hi
ho";
Actual result:
--------------
ho";"hi
--
Edit bug report at http://bugs.php.net/?id=47244&edit=1
--
Try a CVS snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=47244&r=trysnapshot52
Try a CVS snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=47244&r=trysnapshot53
Try a CVS snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=47244&r=trysnapshot60
Fixed in CVS:
http://bugs.php.net/fix.php?id=47244&r=fixedcvs
Fixed in CVS and need be documented:
http://bugs.php.net/fix.php?id=47244&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=47244&r=alreadyfixed
Need backtrace:
http://bugs.php.net/fix.php?id=47244&r=needtrace
Need Reproduce Script:
http://bugs.php.net/fix.php?id=47244&r=needscript
Try newer version:
http://bugs.php.net/fix.php?id=47244&r=oldversion
Not developer issue:
http://bugs.php.net/fix.php?id=47244&r=support
Expected behavior:
http://bugs.php.net/fix.php?id=47244&r=notwrong
Not enough info:
http://bugs.php.net/fix.php?id=47244&r=notenoughinfo
Submitted twice:
http://bugs.php.net/fix.php?id=47244&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=47244&r=globals
PHP 4 support discontinued: http://bugs.php.net/fix.php?id=47244&r=php4
Daylight Savings: http://bugs.php.net/fix.php?id=47244&r=dst
IIS Stability:
http://bugs.php.net/fix.php?id=47244&r=isapi
Install GNU Sed:
http://bugs.php.net/fix.php?id=47244&r=gnused
Floating point limitations:
http://bugs.php.net/fix.php?id=47244&r=float
No Zend Extensions:
http://bugs.php.net/fix.php?id=47244&r=nozend
MySQL Configuration Error:
http://bugs.php.net/fix.php?id=47244&r=mysqlcfg