PEAR is archived and read-only

This mirror preserves historical PEAR package releases and metadata so existing references remain available.

Home » XML » XML_Serializer » Bug #2720

Parse error in XML unserialize

Details

Submitted2004-11-09 02:06 UTC
Fromddalton at shortbus dot net
Assignedschst
StatusBogus
PackageXML_Serializer
PHP Version4.3.9
OSFreebsd
Roadmaps(Not assigned)

Comments

[2004-11-09 02:06 UTC] ddalton at shortbus dot net

Description:
------------
When unserializing:
the following xml:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!-- Edited with XML Spy v4.2 -->
<note>
<to>Tove</to>
<from>Jani</from>
<heading>Reminder</heading>
<body>Don't forget me this weekend!</body>
</note>
I get a parse error with 0.13

Reproduce code:
---------------
function xml2array($data)
{
error_reporting(E_ALL ^ E_NOTICE);
$Unserializer = &new XML_Unserializer();
// Serialize the data structure
$status = $Unserializer->unserialize($data);

// Check whether serialization worked
if (PEAR::isError($status)) {
die($status->getMessage());
}

// return the PHP data structure
return $Unserializer->getUnserializedData();
}

Actual result:
--------------
XML_Parser: syntax error at XML input line 1