Merge branch 'master' of https://github.com/bfabiszewski/ulogger-server
This commit is contained in:
commit
b77f1db6ed
@ -116,6 +116,10 @@
|
|||||||
*/
|
*/
|
||||||
public static function getBaseUrl() {
|
public static function getBaseUrl() {
|
||||||
$proto = (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "" || $_SERVER["HTTPS"] == "off") ? "http://" : "https://";
|
$proto = (!isset($_SERVER["HTTPS"]) || $_SERVER["HTTPS"] == "" || $_SERVER["HTTPS"] == "off") ? "http://" : "https://";
|
||||||
|
// Check if we are behind an https proxy
|
||||||
|
if (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && $_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https') {
|
||||||
|
$proto = 'https://';
|
||||||
|
}
|
||||||
$host = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "";
|
$host = isset($_SERVER["HTTP_HOST"]) ? $_SERVER["HTTP_HOST"] : "";
|
||||||
if (realpath($_SERVER["SCRIPT_FILENAME"])) {
|
if (realpath($_SERVER["SCRIPT_FILENAME"])) {
|
||||||
$scriptPath = substr(dirname(realpath($_SERVER["SCRIPT_FILENAME"])), strlen(ROOT_DIR));
|
$scriptPath = substr(dirname(realpath($_SERVER["SCRIPT_FILENAME"])), strlen(ROOT_DIR));
|
||||||
@ -188,4 +192,4 @@
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user