I'm stupid
This commit is contained in:
parent
df60d482f7
commit
c37a313924
@ -17,13 +17,13 @@ abstract class Route
|
||||
)) return;
|
||||
|
||||
// check if the route matches and add parameters if any
|
||||
// TODO: this is just really messy man wtf
|
||||
if (!isset($_SERVER['PATH_INFO'])) {
|
||||
$_SERVER['PATH_INFO'] = '/';
|
||||
$request_path = str_replace($_SERVER['SCRIPT_NAME'], '', $_SERVER['PHP_SELF']);
|
||||
if ($request_path === '') {
|
||||
$request_path = '/';
|
||||
}
|
||||
$args = [];
|
||||
$path_parts = explode('/', $path);
|
||||
$request_path_parts = explode('/', $_SERVER['PATH_INFO']);
|
||||
$request_path_parts = explode('/', $request_path);
|
||||
for ($i=0; $i < count($path_parts); $i++) {
|
||||
if (empty($path_parts[$i])) {
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user