Merge branch 'fix/ui_get_full_url' into 'develop'

minor fix adding slash if not found

See merge request artica/pandorafms!2623
This commit is contained in:
fbsanchez 2019-07-31 11:05:29 +02:00
commit 75a9306312
1 changed files with 9 additions and 1 deletions

View File

@ -3768,14 +3768,22 @@ function ui_get_full_url($url='', $no_proxy=false, $add_name_php_file=false, $me
if (ui_forced_public_url()) {
$proxy = true;
$fullurl = $config['public_url'];
if (substr($fullurl, -1) != '/') {
$fullurl .= '/';
}
if ($url == 'index.php' && is_metaconsole()) {
$fullurl .= '/'.ENTERPRISE_DIR.'/meta';
$fullurl .= ENTERPRISE_DIR.'/meta';
}
} else if (!empty($config['public_url'])
&& (!empty($_SERVER['HTTP_X_FORWARDED_HOST']))
) {
// Forced to use public url when being forwarder by a reverse proxy.
$fullurl = $config['public_url'];
if (substr($fullurl, -1) != '/') {
$fullurl .= '/';
}
$proxy = true;
} else {
$fullurl = $protocol.'://'.$_SERVER['SERVER_NAME'];