Fixed issue with url pattern matching.

pull/42/merge
Mike Cao 12 years ago
parent ef72548a1a
commit f64774881f

@ -65,7 +65,7 @@ class Route {
$ids = array();
$char = substr($this->pattern, -1);
$this->pattern = str_replace(')', ')?', $this->pattern);
$this->pattern = str_replace(array(')','*'), array(')?','.*?'), $this->pattern);
// Build the regex for matching
$regex = preg_replace_callback(
@ -84,10 +84,6 @@ class Route {
if ($char === '/') {
$regex .= '?';
}
// Replace wildcard
else if ($char === '*') {
$regex = str_replace('*', '.+?', $this->pattern);
}
// Allow trailing slash
else {
$regex .= '/?';

Loading…
Cancel
Save