diff --git a/app/WillySoft/Http/Route.php b/app/WillySoft/Http/Route.php index 89891c1..9d7d666 100644 --- a/app/WillySoft/Http/Route.php +++ b/app/WillySoft/Http/Route.php @@ -12,9 +12,14 @@ abstract class Route { array_map(strtoupper(...), explode('|', $methods)) )) return; - $request_path_parts = explode('/', urldecode( - strtok($_SERVER['REQUEST_URI'], '?') - )); + static $cache; + if (!isset($cache)) { + $cache = explode('/', urldecode( + strtok($_SERVER['REQUEST_URI'], '?') + )); + } + $request_path_parts = $cache; + $path_parts = explode('/', $path); $callback_args = []; for ($i=0; $i < count($path_parts); $i++) {