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
Posted by Dave Hall (skwashd) on 2008-07-25T16:26:50.000+0000
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
Posted by Benjamin Eberlei (beberlei) on 2008-11-07T04:28:49.000+0000
Fixed in trunk. Implementation is using a simple error handler for the Xml parsing to show a specific error message.
Posted by Wil Sinclair (wil) on 2008-11-13T14:10:10.000+0000
Changing issues in preparation for the 1.7.0 release.