Merge branch 'ent-8086-iconos-de-tree-view-metaconsola-rotos' into 'develop'

Some ui_get_full_url improvements

See merge request artica/pandorafms!4449
This commit is contained in:
Daniel Rodriguez 2021-10-07 13:36:30 +00:00
commit f25035db58
1 changed files with 23 additions and 10 deletions

View File

@ -4315,18 +4315,28 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
}
}
$skip_meta_tag = false;
if ($url === '') {
if ($proxy) {
$url = '';
} else {
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.
// Redirect to main.
$url = '?'.$_SERVER['QUERY_STRING'];
}
} else if (empty($url) === true) {
if ($proxy === false) {
$url = $config['homeurl_static'].'/';
if ($metaconsole_root === true
&& is_metaconsole()
) {
$url = $config['homeurl_static'].'/'.ENTERPRISE_DIR.'/meta/';
}
$skip_meta_tag = true;
} else {
$url = '';
}
} else if (!strstr($url, '.php')) {
if ($proxy) {
@ -4354,8 +4364,11 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
$url = substr($url, 1);
}
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
if ($skip_meta_tag === false
&& $metaconsole_root
&& is_metaconsole()
) {
$fullurl .= ENTERPRISE_DIR.'/meta/';
}
return $fullurl.$url;