ZF-12072: Zend_Controller_Action_Helper_Url doesn't encode arrays

Issue Type: Bug Created: 2012-02-25T23:01:47.000+0000 Last Updated: 2012-04-16T19:39:08.000+0000 Status: Resolved Fix version(s): Reporter: Andras Gyomrey (andras) Assignee: Ryan Mauger (bittarman) Tags: - Zend_Controller

Related issues: Attachments:


$_POST decodes correctly myvar%5B0%5D=1. This is returned from Zend_Request::getParam correctly:

Array( 0 => 1 )

when Zend_Controller_Action_Helper_Url::simple($module, $controller, $action, array('myvar' => array(0 => 1))); is called it triggers an E_WARNING because urlencode isn't able to encode arrays.

i believe this can be easily fixed using http_build_query in Zend_Controller_Action_Helper_Url


Posted by Ryan Mauger (bittarman) on 2012-04-16T19:39:08.000+0000

It appears that you probably expected the url helper to produce the query string for your url, but this is not the intent of the component, it is only for reversing a route to produce the path section of the url. to produce your query string, please use http_build_query as you mentioned above.

I am closing this, as there is no support for array parameters in routes at all, so this is just not going to be possible to implement in a sane way.

Have you found an issue?

See the Overview section for more details.


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

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