This commit is contained in:
William 2023-01-27 13:09:02 +00:00
parent ecd318498f
commit 3dfee69beb

View File

@ -12,10 +12,16 @@ abstract class Route {
array_map(strtoupper(...), explode('|', $methods))
)) return;
$callback_args = [];
$request_path = urldecode($_SERVER['REQUEST_URI']);
static $request_path_parts;
if (!isset($request_path_parts)) {
$request_path_parts = explode('/', urldecode(
strtok($_SERVER['REQUEST_URI'], '?')
)
);
}
$path_parts = explode('/', $path);
$request_path_parts = explode('/', $request_path);
$callback_args = [];
for ($i=0; $i < count($path_parts); $i++) {
if (empty($path_parts[$i])) {
continue;