Details
-
Type:
Bug
-
Status:
Resolved
-
Priority:
Minor
-
Resolution: Fixed
-
Affects Version/s: 1.7.1
-
Fix Version/s: 1.9.7
-
Component/s: Zend_Controller
-
Labels:None
Description
Example
$this->_setParam('foo', 0);
$foo = $this->_getParam('foo', -1);
$foo is set to -1 instead of the expected value 0
This is because the method in Controller/Action.php does a null == $value check instead of null === $value.
It should be modified to look like this:
protected function _getParam($paramName, $default = null)
{
$value = $this->getRequest()->getParam($paramName);
if ((null === $value) && (null !== $default)) {
$value = $default;
}
return $value;
}
Attachments
Issue Links
| This issue is duplicated by: | ||||
| ZF-8638 | Zend_Controller_Action::_getParam() incorrectly assigns default value |
|
|
|
Set component and auto reassign