ZF-10922: Zend_Rest_Client_Result::getStatus() generates PHP Notice with unexpected sxml

Issue Type: Bug Created: 2011-01-06T18:00:03.000+0000 Last Updated: 2012-03-22T09:24:39.000+0000 Status: Open Fix version(s): Reporter: twk (twk) Assignee: Davey Shafik (davey) Tags: - Zend_Rest_Client

Related issues: Attachments:


We found some notices in our error log.

PHP Notice: Undefined offset: 0 in /usr/local/lib/php/Zend/Rest/Client/Result.php

<pre class="highlight">
    public function getStatus()
        $status = $this->_sxml->xpath('//status/text()');
        $status = strtolower($status[0]);  # HERE WE GET NOTICE

Probably notice is caused by the invalid result. I think you need to check $status like "if (sizeof($result) > 1)" to suppress the notice.


No comments to display

Have you found an issue?

See the Overview section for more details.


© 2006-2018 by Zend, a Rogue Wave Company. Made with by awesome contributors.

This website is built using zend-expressive and it runs on PHP 7.