|
@ -39,7 +39,7 @@ class Route |
|
|
|
|
|
|
|
|
for ($i = 0; $i < $cnt; $i++) { |
|
|
for ($i = 0; $i < $cnt; $i++) { |
|
|
if (substr($parts[$i], 0, 1) == ':') { |
|
|
if (substr($parts[$i], 0, 1) == ':') { |
|
|
$this->params[substr($parts[$i], 1)] = $request[$i]; |
|
|
|
|
|
|
|
|
$this->params[substr($parts[$i], 1)] = urldecode($request[$i]); |
|
|
} elseif (substr($parts[$i], 0, 2) == '(?') { |
|
|
} elseif (substr($parts[$i], 0, 2) == '(?') { |
|
|
$match = array(); |
|
|
$match = array(); |
|
|
if (!preg_match('#^' . $parts[$i] . '$#iu', $request[$i], $match)) { |
|
|
if (!preg_match('#^' . $parts[$i] . '$#iu', $request[$i], $match)) { |
|
@ -47,7 +47,7 @@ class Route |
|
|
} |
|
|
} |
|
|
$start = strpos($parts[$i], '<') + 1; |
|
|
$start = strpos($parts[$i], '<') + 1; |
|
|
$key = substr($parts[$i], $start, strpos($parts[$i], '>', $start) - $start); |
|
|
$key = substr($parts[$i], $start, strpos($parts[$i], '>', $start) - $start); |
|
|
$this->params[$key] = $match[$key]; |
|
|
|
|
|
|
|
|
$this->params[$key] = urldecode($match[$key]); |
|
|
} elseif ($parts[$i] != $request[$i]) { |
|
|
} elseif ($parts[$i] != $request[$i]) { |
|
|
return false; |
|
|
return false; |
|
|
} |
|
|
} |
|
|