|
|
@@ -1779,14 +1779,23 @@ function bx_check_redirect_to_correct_hostname ($bProcessRedirect = false)
|
|
|
$bRedirectRequired = isset($_SERVER['HTTP_HOST']) && 0 !== strcasecmp($_SERVER['HTTP_HOST'], $aUrl['host']) && 0 !== strcasecmp($_SERVER['HTTP_HOST'], $aUrl['host'] . ':' . (!empty($aUrl['port']) ? $aUrl['port'] : $iPortDefault));
|
|
|
|
|
|
if ($bRedirectRequired && $bProcessRedirect) {
|
|
|
- $sPort = empty($aUrl['port']) || 80 == $aUrl['port'] || 443 == $aUrl['port'] ? '' : ':' . $aUrl['port'];
|
|
|
- header("Location:{$aUrl['scheme']}://{$aUrl['host']}{$sPort}{$_SERVER['REQUEST_URI']}", true, 301);
|
|
|
+ header("Location:" . bx_get_self_url(), true, 301);
|
|
|
exit;
|
|
|
}
|
|
|
|
|
|
return $bRedirectRequired;
|
|
|
}
|
|
|
|
|
|
+/**
|
|
|
+ * Get URL of current page
|
|
|
+ */
|
|
|
+function bx_get_self_url ()
|
|
|
+{
|
|
|
+ $aUrl = parse_url(BX_DOL_URL_ROOT);
|
|
|
+ $sPort = empty($aUrl['port']) || 80 == $aUrl['port'] || 443 == $aUrl['port'] ? '' : ':' . $aUrl['port'];
|
|
|
+ return "{$aUrl['scheme']}://{$aUrl['host']}{$sPort}{$_SERVER['REQUEST_URI']}";
|
|
|
+}
|
|
|
+
|
|
|
/**
|
|
|
* Check if redirect to remove install folder.
|
|
|
* If BX_SKIP_INSTALL_CHECK is defined then this redirect checking is skipped.
|
|
|
@@ -2124,4 +2133,4 @@ function bx_birthday2age($sBirthday)
|
|
|
return $iResult;
|
|
|
}
|
|
|
|
|
|
-/** @} */
|
|
|
+/** @} */
|