Issues

ZF-3647: Zend_Rest_Client_Result::getStatus() incorrectly assumes $this->_sxml is an object

Description

note Consider this post Public Domain.

line 43 of Rest/Client/Result.php, within __construct(): $this->_sxml = simplexml_load_string($data);

If the $data is malformed or invalid xml, $this->_sxml can contain (bool) False.

line 147 of Rest/Client/Result.php, within getStatus(): $status = $this->_sxml->xpath('//status/text()');

Since $this->_sxml is (bool) False, it breaks.

Insert at line 147: if ($this->_sxml === false) return False;

Comments

Similar issue reported in ZF-3705

I hope this gets fixed in 1.6 as we can not guarantee that a remote service will always serve up valid xml - although it should

Fixed in trunk. Implementation is using a simple error handler for the Xml parsing to show a specific error message.

Changing issues in preparation for the 1.7.0 release.