Issues

ZF-6399: Zend_Controller_Router_Route_Module generates warning when used in Zend_Controller_Router_Route_Chain

Description

match function of Zend_Controller_Router_Route_Module when called from Chain route calls setMatchedPath with array parameter when it should call it with string parameter and contained what it MATCHED there not what LEFT to be matched.

Array is empty or consists of elements that had left after stripping module/controller/action URL parts


    public function match($path)
    {
        $this->_setRequestKeys();

        $values = array();
        $params = array();
        
        if (!$this->isPartial()) {
            $path = trim($path, self::URI_DELIMITER);
        }

        if ($path != '') {
            $path = explode(self::URI_DELIMITER, $path);

            if ($this->_dispatcher && $this->_dispatcher->isValidModule($path[0])) {
                $values[$this->_moduleKey] = array_shift($path);
                $this->_moduleValid = true;
            }

            if (count($path) && !empty($path[0])) {
                $values[$this->_controllerKey] = array_shift($path);
            }

            if (count($path) && !empty($path[0])) {
                $values[$this->_actionKey] = array_shift($path);
            }

            if ($numSegs = count($path)) {
                for ($i = 0; $i < $numSegs; $i = $i + 2) {
                    $key = urldecode($path[$i]);
                    $val = isset($path[$i + 1]) ? urldecode($path[$i + 1]) : null;
                    $params[$key] = (isset($params[$key]) ? (array_merge((array) $params[$key], array($val))): $val);
                }
            }
        }
        
        if ($this->isPartial()) {
>>>>>            $this->setMatchedPath($path);  <<<<<<< Array here SHOULD BE STRING.
        }

        $this->_values = $values + $params;

        return $this->_values + $this->_defaults;
    }

Comments

Assigning to Ben Scholzen