Home » Web Services » Services_Amazon » Bug #7235
Deserialize error not caught
Details
| Submitted | 2006-03-29 07:40 UTC |
|---|---|
| From | jbruyndonckx at telenet dot be |
| Assigned | ttsuruoka |
| Status | Closed |
| Package | Services_Amazon |
| PHP Version | 5.1.2 |
| OS | Windows 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!