Zend Framework

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

Details

  • Type: Bug Bug
  • Status: Resolved Resolved
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: 1.5.2
  • Fix Version/s: 1.7.0
  • Component/s: Zend_Rest_Client
  • Labels:
    None

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;

Issue Links

Activity

Hide
Dave Hall added a comment -

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

Show
Dave Hall added a comment - 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
Hide
Benjamin Eberlei added a comment -

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

Show
Benjamin Eberlei added a comment - Fixed in trunk. Implementation is using a simple error handler for the Xml parsing to show a specific error message.
Hide
Wil Sinclair added a comment -

Changing issues in preparation for the 1.7.0 release.

Show
Wil Sinclair added a comment - Changing issues in preparation for the 1.7.0 release.

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated:
    Resolved: