Index: tests/Zend/Controller/Request/HttpTest.php =================================================================== --- tests/Zend/Controller/Request/HttpTest.php (revision 18232) +++ tests/Zend/Controller/Request/HttpTest.php (working copy) @@ -675,6 +675,30 @@ } /** + * @group ZF-5107 + */ + public function testParamSourcesHonoredByGetParams() + { + $_GET = array( + 'get' => true + ); + $_POST = array( + 'post' => true + ); + $params = array( + 'foo' => 'bar', + 'boo' => 'bah', + 'fee' => 'fi' + ); + $this->_request->setParams($params); + + $this->_request->setParamSources(array('_POST')); + $expected = array_merge($params, $_POST); + $received = $this->_request->getParams(); + $this->assertEquals($expected, $received); + } + + /** * @group ZF-3161 * @group ZFI-233 * @group ZF-5818 Index: library/Zend/Controller/Request/Http.php =================================================================== --- library/Zend/Controller/Request/Http.php (revision 18232) +++ library/Zend/Controller/Request/Http.php (working copy) @@ -727,10 +727,12 @@ public function getParams() { $return = $this->_params; - if (isset($_GET) && is_array($_GET)) { + + $paramSources = $this->getParamSources(); + if (isset($_GET) && is_array($_GET) && in_array('_GET', $paramSources)) { $return += $_GET; } - if (isset($_POST) && is_array($_POST)) { + if (isset($_POST) && is_array($_POST) && in_array('_POST', $paramSources)) { $return += $_POST; } return $return;