#10494 [Com]: ' crashes wddx_deserialize
| From: | show-boat477 at hotmail dot com | Date: | Tue, 20 Jul 2004 15:01:29 +0000 |
| Subject: | #10494 [Com]: ' crashes wddx_deserialize | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-62812@lists.php.net to get a copy of this message | ||
ID: 10494
Comment by: show-boat477 at hotmail dot com
Reported By: gin at gintonyx dot de
Status: Closed
Bug Type: WDDX related
Operating System: solaris (?) hosted by puretec.de
PHP Version: 4.0.4pl1
New Comment:
<a href=http://iaverage-anime-down.da.ru>boat
show</a>
Previous Comments:
------------------------------------------------------------------------
[2001-04-25 16:16:57] andrei@php.net
Fixed in CVS.
------------------------------------------------------------------------
[2001-04-25 13:49:29] gin at gintonyx dot de
<?
$arr = array("hello"=>"there", "i'm" => 30);
foreach ($arr as $name => $value)
echo("name: $name, value: $value<br>\n");
$packet = wddx_serialize_vars("arr");
echo(htmlentities($packet) . "<br>\n");
$newarr = wddx_deserialize($packet);
echo("newarr: $newarr<br>\n");
foreach ($newarr["arr"] as $name => $value)
echo("name: $name, value: $value<br>\n");
?>
result is this:
> name: hello, value: there
> name: i'm, value: 30
> <wddxPacket version='1.0'><header/><data><struct><var
name='arr'><struct><var >
name='hello'><string>there</string></var><var
>
name='i'm'><number>30</number></var></struct></var></struct></data></wddxPacket>
> newarr:
>
> Result:
> Warning: Invalid argument supplied for foreach() in whatever.php on
line 12
Changing 'i'm' on line 2 to 'i am' solves the "crash".
Maybe the ' char should have to be mapped to \' or something else... I
dunno. Just wanted to let you know...
PHP ROCKS!
-Gin
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=10494&edit=1