From cccfcea833a583b9d7125b531fecec0041a10806 Mon Sep 17 00:00:00 2001 From: Degiovanni Emilio Date: Wed, 13 Apr 2016 15:31:11 -0300 Subject: [PATCH] Problem with module in upper With a default router /:module/:controller/:action/:params all works fine. But for example in URL request /MODULE/controller/action (module in upper) get error Notice: Undefined index: MODULE in \vendor\zendframework\zendframework1\library\Zend\Controller\Dispatcher\Standard.php on line 397 In $controllerDirs all key are in lowercase Other solution modify the Request Abstract Class ```php abstract class Zend_Controller_Request_Abstract { /** * Retrieve the module name * * @return string */ public function getModuleName() { if (null === $this->_module) { $this->setModuleName($this->getParam($this->getModuleKey())); } return $this->_module; } /** * Set the module name to use * * @param string $value * @return Zend_Controller_Request_Abstract */ public function setModuleName($value) { $this->_module = strtolower($value); return $this; } } ``` --- library/Zend/Controller/Dispatcher/Standard.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/Zend/Controller/Dispatcher/Standard.php b/library/Zend/Controller/Dispatcher/Standard.php index 492056e42a..73abb7194d 100644 --- a/library/Zend/Controller/Dispatcher/Standard.php +++ b/library/Zend/Controller/Dispatcher/Standard.php @@ -394,7 +394,7 @@ public function getControllerClass(Zend_Controller_Request_Abstract $request) $module = $request->getModuleName(); if ($this->isValidModule($module)) { $this->_curModule = $module; - $this->_curDirectory = $controllerDirs[$module]; + $this->_curDirectory = $controllerDirs[strtolower($module)]; } elseif ($this->isValidModule($this->_defaultModule)) { $request->setModuleName($this->_defaultModule); $this->_curModule = $this->_defaultModule;