fix bug in route handles method.

This commit is contained in:
Taylor Otwell
2012-01-18 15:28:16 -06:00
parent 7fa80bcdba
commit 9bcbe6a357
2 changed files with 5 additions and 4 deletions

View File

@@ -214,11 +214,11 @@ class Route {
*/
public function handles($uri)
{
$pattern = '#'.str_replace('*', '(.*)', $uri).'#';
$pattern = ($uri !== '/') ? str_replace('*', '(.*)', $uri) : '^/$';
return ! is_null(array_first($this->uris, function($key, $uri) use ($pattern)
{
return preg_match($pattern, $uri);
return preg_match('#'.$pattern.'#', $uri);
}));
}