ZF-9179: _getParam second parameter no longer working when used in conjunction with routes

Issue Type: Bug Created: 2010-02-15T02:55:46.000+0000 Last Updated: 2010-08-05T11:37:08.000+0000 Status: Resolved Fix version(s): - 1.10.8 (25/Aug/10)

Reporter: Diane Rodriguez (adelaine) Assignee: Martin Hujer (mhujer) Tags: - Zend_Controller

Related issues: Attachments: - ZF-9179.patch


Ever since we upgraded to ZF 1.9.7, _getParam no longer replaces "empty" values with the second parameter. This is related to ZF-5163.

When a route has been defined as follows:

<pre class="highlight">
$route = new Zend_Controller_Router_Route( ':lang/:controller/:action/*',
                    'action' => 'index',

and the user types a URL like "",

  • _getParam('lang') returns an empty string instead of null
  • _getParam('lang','en') now returns an empty string(!). Prior to ZF 1.9.7, it returns 'en', which is the expected result.

Since our application relies on routes, upgrading to 1.9.7 broke several major modules.


Posted by Tomáš Fejfar ( on 2010-06-16T05:43:57.000+0000

Still not fixed in 1.10.5...

Posted by Martin Hujer (mhujer) on 2010-06-19T05:46:33.000+0000

Attaching patch.

Posted by Matthew Weier O'Phinney (matthew) on 2010-08-05T11:37:07.000+0000

Patch applied in trunk and 1.10 release branch.

Have you found an issue?

See the Overview section for more details.


© 2006-2021 by Zend by Perforce. Made with by awesome contributors.

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