Get set url / endpoints end remove ending '/' if present
*/
$raw_set_url = $route;
(substr($raw_set_url, -1) == '/') && $raw_set_url = substr($raw_set_url, 0, -1);
// URL decode for set route as well, ensuring consistency in comparison
$raw_set_url = urldecode($raw_set_url);
/*
Convert requested url and set endpoints to arrays and get their length
*/
$req_url_with_query = explode('?', $raw_req_url);
$req_url_arr = explode('/', substr($req_url_with_query[0], 1));
$req_url_len = count($req_url_arr);
I found that sparkle framework is not support non-ASCII characters so I modifed it to support this feature.
Chnage code in /core/Route.php
From original code to
`private static function validateRoute($route, $type, array | callable ...$functions) { /*
Get requested url / endpoint ending '/' if present */ $raw_req_url = explode('?', $_SERVER['REQUEST_URI'])[0]; $raw_req_url = urldecode($raw_req_url); // Decode URL to handle non-ASCII characters (substr($raw_req_url, -1) == '/') && $raw_req_url = substr($raw_req_url, 0, -1);
/*
Get set url / endpoints end remove ending '/' if present */ $raw_set_url = $route; (substr($raw_set_url, -1) == '/') && $raw_set_url = substr($raw_set_url, 0, -1);
// URL decode for set route as well, ensuring consistency in comparison $raw_set_url = urldecode($raw_set_url);
/*
Convert requested url and set endpoints to arrays and get their length */ $req_url_with_query = explode('?', $raw_req_url); $req_url_arr = explode('/', substr($req_url_with_query[0], 1)); $req_url_len = count($req_url_arr);
$set_url_arr = explode('/', substr($raw_set_url, 1)); $set_url_len = count($set_url_arr);
// ...rest of the method remains unchanged...`