Issues

ZF-6399: Zend_Controller_Router_Route_Module generates warning when used in Zend_Controller_Router_Route_Chain

Issue Type: Bug Created: 2009-04-23T12:00:12.000+0000 Last Updated: 2009-04-23T13:59:48.000+0000 Status: Resolved Fix version(s): - 1.8.0 (30/Apr/09)

Reporter: Anjey Lobas (anjey) Assignee: Ben Scholzen (dasprid) Tags: - Zend_Controller

Related issues: Attachments:

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

<pre class="highlight">
    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

Posted by Matthew Weier O'Phinney (matthew) on 2009-04-23T13:15:37.000+0000

Assigning to Ben Scholzen

Have you found an issue?

See the Overview section for more details.

Copyright

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

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

Contacts