Merge branch 'ent-7990-error-servicios-metaconsola-detras-de-un-reverse-proxy' into 'develop'

Please check carefully this change

See merge request artica/pandorafms!4442
This commit is contained in:
Daniel Rodriguez 2021-10-06 08:32:46 +00:00
commit 8b889b6c5b
1 changed files with 13 additions and 23 deletions

View File

@ -4290,10 +4290,6 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
if (substr($fullurl, -1) != '/') {
$fullurl .= '/';
}
if ($url == 'index.php' && is_metaconsole()) {
$fullurl .= ENTERPRISE_DIR.'/meta';
}
} else if (!empty($config['public_url'])
&& (!empty($_SERVER['HTTP_X_FORWARDED_HOST']))
) {
@ -4332,40 +4328,34 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
// Only add the home url.
$url = $config['homeurl_static'].'/';
}
if (is_metaconsole() && $metaconsole_root) {
$url .= 'enterprise/meta/';
}
} else if (!strstr($url, '.php')) {
if ($proxy) {
$fullurl .= '/';
} else {
$fullurl .= $config['homeurl_static'].'/';
}
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
} else {
if ($proxy) {
$fullurl .= '/';
} else {
if ((bool) $proxy === false) {
if ($add_name_php_file) {
$fullurl .= $_SERVER['SCRIPT_NAME'];
} else {
$fullurl .= $config['homeurl_static'].'/';
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
}
}
}
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);
}
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
return $fullurl.$url;