From 8764413597018b25be321f5f940aa09a205868c7 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 6 Oct 2021 15:07:46 +0200 Subject: [PATCH 1/3] Some ui_get_full_url improvements --- pandora_console/include/functions_ui.php | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 322496228d..22f98a57bf 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4315,18 +4315,15 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me } } - if ($url === '') { - if ($proxy) { - $url = ''; - } else { + $skip_meta_tag = false; + if (empty($url) === true) { + if ($proxy === false) { $url = $_SERVER['REQUEST_URI']; - } - } else if ($url === false) { - if ($proxy) { - $url = ''; + // Already inserted in request_uri. + $skip_meta_tag = true; } else { - // Only add the home url. - $url = $config['homeurl_static'].'/'; + // Redirect to main. + $url = '?'.$_SERVER['QUERY_STRING']; } } else if (!strstr($url, '.php')) { if ($proxy) { @@ -4354,7 +4351,10 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me $url = substr($url, 1); } - if (is_metaconsole() && $metaconsole_root) { + if ($skip_meta_tag === false + && $metaconsole_root + && is_metaconsole() + ) { $fullurl .= 'enterprise/meta/'; } From 35eb1d07901547d71af6eb09c93a291f96a1c4f3 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Wed, 6 Oct 2021 15:13:21 +0200 Subject: [PATCH 2/3] Some ui_get_full_url improvements --- pandora_console/include/functions_ui.php | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 22f98a57bf..45f2cb708d 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4316,7 +4316,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me } $skip_meta_tag = false; - if (empty($url) === true) { + if ($url === '') { if ($proxy === false) { $url = $_SERVER['REQUEST_URI']; // Already inserted in request_uri. @@ -4325,6 +4325,17 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me // Redirect to main. $url = '?'.$_SERVER['QUERY_STRING']; } + } else if (empty($url) === true) { + if ($proxy === false) { + $url = $config['homeurl_static'].'/'; + if ($metaconsole_root === true) { + $url = $config['homeurl_static'].'/'.ENTERPRISE_DIR.'/meta/'; + } + + $skip_meta_tag = true; + } else { + $url = ''; + } } else if (!strstr($url, '.php')) { if ($proxy) { $fullurl .= '/'; @@ -4355,7 +4366,7 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me && $metaconsole_root && is_metaconsole() ) { - $fullurl .= 'enterprise/meta/'; + $fullurl .= ENTERPRISE_DIR.'/meta/'; } return $fullurl.$url; From 2050c137ec8d4ccc701195bfee33665b604126d5 Mon Sep 17 00:00:00 2001 From: fbsanchez Date: Thu, 7 Oct 2021 12:25:41 +0200 Subject: [PATCH 3/3] errata fix --- pandora_console/include/functions_ui.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/pandora_console/include/functions_ui.php b/pandora_console/include/functions_ui.php index 45f2cb708d..a9759730ea 100755 --- a/pandora_console/include/functions_ui.php +++ b/pandora_console/include/functions_ui.php @@ -4328,7 +4328,9 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me } else if (empty($url) === true) { if ($proxy === false) { $url = $config['homeurl_static'].'/'; - if ($metaconsole_root === true) { + if ($metaconsole_root === true + && is_metaconsole() + ) { $url = $config['homeurl_static'].'/'.ENTERPRISE_DIR.'/meta/'; }