#47244 [Opn->Bgs]: serialize() of a string with a line break (\r) broken.

From: Date: Thu, 29 Jan 2009 23:59:13 +0000
Subject: #47244 [Opn->Bgs]: serialize() of a string with a line break (\r) broken.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-133305@lists.php.net to get a copy of this message
ID: 47244 Updated by: iliaa@php.net Reported By: nir at winpdb dot org -Status: Open +Status: Bogus Bug Type: *General Issues Operating System: Ubuntu Intrepid PHP Version: 5.2.8 New Comment: It works fine in CVS, its possible that the \r char when output is causing formatting error that hides other chars. Previous Comments: ------------------------------------------------------------------------ [2009-01-29 20:32:57] nir at winpdb dot org 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 this bug report at http://bugs.php.net/?id=47244&edit=1

« previous php.bugs (#133305) next »