Zend Framework

Chain route does not match a chain with Zend_Controller_Router_Route wildcard

Details

  • Type: Bug Bug
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Duplicate
  • Affects Version/s: 1.8.4
  • Fix Version/s: None
  • Component/s: Zend_Controller
  • Labels:
    None

Description

Chaining does not work with the normal Zend_Controller_Router_Route when wildcards are used

/user/:id/:action/* does not work because getMatchedPath() from the route is not returning the right matched path.
It ignores the wildcard...

Fix is here:
$matchedPath .= $path[$i] . $this->_urlDelimiter;

on Zend_Controller_Router_Route match()

// If it's a wildcard, get the rest of URL as wildcard data and stop matching
                if ($this->_parts[$pos] == '*') {
                    $count = count($path);
                    for($i = $pos; $i < $count; $i+=2) {
                        $var = urldecode($path[$i]);
                        if (!isset($this->_wildcardData[$var]) && !isset($this->_defaults[$var]) && !isset($values[$var])) {
                            $this->_wildcardData[$var] = (isset($path[$i+1])) ? urldecode($path[$i+1]) : null;
                            $matchedPath .= $path[$i] . $this->_urlDelimiter;
                        }
                    }
                    break;
                }

Issue Links

Activity

Hide
Jason Webster added a comment -

Closed as duplicate of #ZF-6654

Show
Jason Webster added a comment - Closed as duplicate of #ZF-6654

People

Vote (0)
Watch (0)

Dates

  • Created:
    Updated:
    Resolved: