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 .= '/?';