ZF-6852: Zend_Rest_Server::returnResponse() null == $flag should be null === $flag
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
public function returnResponse($flag = null)
{
if (null == $flag) { //<-- 2 equal signs
return $this->_returnResponse;
}
$this->_returnResponse = ($flag) ? true : false;
return $this;
}
to
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