mirror of
https://github.com/stylersnico/librenms.git
synced 2026-07-30 16:14:21 +02:00
check for sites where there is no subdirectory
This commit is contained in:
@@ -11,9 +11,14 @@ foreach ($_GET as $key => $get_var) {
|
||||
}
|
||||
}
|
||||
|
||||
$segments = explode('/', trim($_SERVER['REQUEST_URI'], '/'));
|
||||
$base_url = parse_url($config["base_url"]);
|
||||
$segments = explode('/', trim(str_replace($base_url["path"], "", $_SERVER['REQUEST_URI']), '/'));
|
||||
// don't parse the subdirectory, if there is one in the path
|
||||
if (strlen($base_url["path"]) > 1) {
|
||||
$segments = explode('/', trim(str_replace($base_url["path"], "", $_SERVER['REQUEST_URI']), '/'));
|
||||
}
|
||||
else {
|
||||
$segments = explode('/', trim($_SERVER['REQUEST_URI'], '/'));
|
||||
}
|
||||
|
||||
foreach ($segments as $pos => $segment) {
|
||||
$segment = urldecode($segment);
|
||||
|
||||
Reference in New Issue
Block a user