php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #10494 ' crashes wddx_deserialize
Submitted: 2001-04-25 13:49 UTC Modified: 2001-04-25 16:16 UTC
From: gin at gintonyx dot de Assigned:
Status: Closed Package: WDDX related
PHP Version: 4.0.4pl1 OS: solaris (?) hosted by puretec.de
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: gin at gintonyx dot de
New email:
PHP Version: OS:

 

 [2001-04-25 13:49 UTC] 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

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-04-25 16:16 UTC] andrei@php.net
Fixed in CVS.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Nov 06 11:01:27 2024 UTC