From ec8d5b4fe4237180968b11b926069ecd4389aeb8 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Tue, 5 Oct 2021 15:09:30 +0200 Subject: [PATCH] Please check carefully this change --- pandora_console/include/functions_ui.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index a02fd3baf7..f61c89c106 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -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;