Issues

ZF-6852: Zend_Rest_Server::returnResponse() null == $flag should be null === $flag

Issue Type: Bug Created: 2009-05-28T12:45:49.000+0000 Last Updated: 2011-08-04T09:46:27.000+0000 Status: Resolved Fix version(s): - 1.9.0 (31/Jul/09)

Reporter: Dwayne McFarlane (dwayneam@gmail.com) Assignee: Satoru Yoshida (satoruyoshida) Tags: - Zend_Rest_Server

Related issues: Attachments:

Description

since null == null and null == false and null == 0 but null === null and null !== false and null !== 0

the Zend_Rest_Server::returnResponse() function should be changed form

<pre class="highlight">
    public function returnResponse($flag = null)
    {
        if (null == $flag) { //<-- 2 equal signs
            return $this->_returnResponse;
        }

        $this->_returnResponse = ($flag) ? true : false;
        return $this;
    }

to

<pre class="highlight">
    public function returnResponse($flag = null)
    {
        if (null === $flag) { //<-- 3 equal signs or use is_null()
            return $this->_returnResponse;
        }

        $this->_returnResponse = ($flag) ? true : false;
        return $this;
    }

The way it is now, if you try to set it to false, it thinks it's null and returns $this->_returnResponse instead of setting it.

Comments

Posted by old of Satoru Yoshida (yoshida@zend.co.jp) on 2009-06-28T17:25:27.000+0000

Solved in SVN r16347

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts