PEAR is discontinued

This is a static archive preserving historical releases and metadata. No new packages or updates will be published. For updates to existing packages, or to publish new packages, please use Composer and Packagist.

Home » Web Services » Services_Amazon » Bug #7235

Deserialize error not caught

Details

Submitted2006-03-29 07:40 UTC
Fromjbruyndonckx at telenet dot be
Assignedttsuruoka
StatusClosed
PackageServices_Amazon
PHP Version5.1.2
OSWindows XP
Roadmaps(Not assigned)

Comments

[2006-03-29 07:40 UTC] jbruyndonckx at telenet dot be

Description:
------------
Hi,

When an error occurs during deserialisation, then the getUnserializedData() is empty. The real error can be retrieved by looking at the return value of $xml->unserialize(). Also, then return value of this last function should be checked against being a PEAER_Error.

This code snipped at line 935 in AmazonECS4.php fixed the problem.

$result = $http->getResponseBody();
$xml = &new XML_Unserializer(array('parseAttributes' => true));
$data = $xml->unserialize($result, false);
if (PEAR::isError ($data)) {
return $data ;
}
$data = $xml->getUnserializedData();
if (PEAR::isError ($data)) {
return $data ;
}
if (isset($data['Error'])) {
$errormsg = $data['Error']['Code'] . ': ' . $data['Error']['Message'];
return PEAR::raiseError($errormsg);
}

[2006-05-20 10:28 UTC] ttsuruoka at php dot net

This has been fixed in 0.5.0.

Thank you for reporting!