// Fix 404 redirection in dispatcher

This commit is contained in:
rMalie
2012-01-09 14:28:34 +00:00
parent 344cd3915e
commit 76e9a80bbe
+2 -2
View File
@@ -418,7 +418,7 @@ class DispatcherCore
$keywords = $transform_keywords; $keywords = $transform_keywords;
} }
$regexp = '#^/'.$regexp.'#u'; $regexp = '#^/'.$regexp.'(\?.*)?$#u';
$this->routes[$route_id] = array( $this->routes[$route_id] = array(
'rule' => $rule, 'rule' => $rule,
'regexp' => $regexp, 'regexp' => $regexp,
@@ -552,7 +552,7 @@ class DispatcherCore
{ {
if (!$this->request_uri) if (!$this->request_uri)
return strtolower($this->controller_not_found); return strtolower($this->controller_not_found);
$controller = $this->default_controller; $controller = $this->controller_not_found;
// Add empty route as last route to prevent this greedy regexp to match request uri before right time // Add empty route as last route to prevent this greedy regexp to match request uri before right time
if ($this->empty_route) if ($this->empty_route)