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

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) != '/') { if (substr($fullurl, -1) != '/') {
$fullurl .= '/'; $fullurl .= '/';
} }
if ($url == 'index.php' && is_metaconsole()) {
$fullurl .= ENTERPRISE_DIR.'/meta';
}
} else if (!empty($config['public_url']) } else if (!empty($config['public_url'])
&& (!empty($_SERVER['HTTP_X_FORWARDED_HOST'])) && (!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. // Only add the home url.
$url = $config['homeurl_static'].'/'; $url = $config['homeurl_static'].'/';
} }
if (is_metaconsole() && $metaconsole_root) {
$url .= 'enterprise/meta/';
}
} else if (!strstr($url, '.php')) { } else if (!strstr($url, '.php')) {
if ($proxy) { if ($proxy) {
$fullurl .= '/'; $fullurl .= '/';
} else { } else {
$fullurl .= $config['homeurl_static'].'/'; $fullurl .= $config['homeurl_static'].'/';
} }
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
} else { } else {
if ($proxy) { if ((bool) $proxy === false) {
$fullurl .= '/';
} else {
if ($add_name_php_file) { if ($add_name_php_file) {
$fullurl .= $_SERVER['SCRIPT_NAME']; $fullurl .= $_SERVER['SCRIPT_NAME'];
} else { } else {
$fullurl .= $config['homeurl_static'].'/'; $fullurl .= $config['homeurl_static'].'/';
if (is_metaconsole() && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
} }
} }
} }
if (substr($fullurl, -1, 1) === substr($url, 0, 1)) { // Add last slash if missing.
if (substr($fullurl, -1, 1) === '/') { if (substr($fullurl, -1, 1) !== '/') {
$url = substr($url, 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; return $fullurl.$url;