From f64774881fdd810ec4d32b3001e0fa32d761a5e2 Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Fri, 14 Jun 2013 00:21:28 -0700 Subject: [PATCH] Fixed issue with url pattern matching. --- flight/net/Route.php | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/flight/net/Route.php b/flight/net/Route.php index 9c501e1..f95a6a9 100644 --- a/flight/net/Route.php +++ b/flight/net/Route.php @@ -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 .= '/?';