fixed homepage
This commit is contained in:
parent
0c96ba6c90
commit
f19f59d53a
@ -23,10 +23,18 @@ class Router {
|
||||
|
||||
private function preparePath() {
|
||||
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
|
||||
|
||||
//homepage
|
||||
if ($path === '/') {
|
||||
return $path;
|
||||
}
|
||||
|
||||
// remove empty directory path
|
||||
$path = rtrim($path, '/'); // remove trailing slash
|
||||
|
||||
//remove anything after and including ampersand
|
||||
$path = preg_replace('/&.+$/', '', $path);
|
||||
|
||||
|
||||
return $path;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user