Please check carefully this change

This commit is contained in:
fbsanchez 2021-10-05 15:09:30 +02:00
parent 0dd98b21f3
commit ec8d5b4fe4
1 changed files with 11 additions and 5 deletions

View File

@ -4348,7 +4348,9 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
}
} else {
if ($proxy) {
$fullurl .= '/';
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
} else {
if ($add_name_php_file) {
$fullurl .= $_SERVER['SCRIPT_NAME'];
@ -4362,10 +4364,14 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
}
}
if (substr($fullurl, -1, 1) === substr($url, 0, 1)) {
if (substr($fullurl, -1, 1) === '/') {
$url = substr($url, 1);
}
// Add last slash if missing.
if (substr($fullurl, -1, 1) !== '/') {
$fullurl .= '/';
}
// Remove starting slash if present.
if (substr($url, 0, 1) === '/') {
$url = substr($url, 1);
}
return $fullurl.$url;