diff --git a/flight/Router.php b/flight/Router.php index 3b8afed..bac7e8e 100644 --- a/flight/Router.php +++ b/flight/Router.php @@ -1,6 +1,6 @@ * @license http://www.opensource.org/licenses/mit-license.php @@ -72,10 +72,10 @@ class Router { */ public function route(&$request) { $params = array(); - $routes = $this->routes[$request->method] + ($this->routes['*'] ?: array()); + $routes = ($this->routes[$request->method] ?: array()) + ($this->routes['*'] ?: array()); foreach ($routes as $pattern => $callback) { - if ($request->url === $pattern || self::match($pattern, $request->url, $params)) { + if ($pattern === '*' || $request->url === $pattern || self::match($pattern, $request->url, $params)) { $request->matched = $pattern; return array($callback, array($params)); }