Update Tools.php

Former-commit-id: 688376241f
This commit is contained in:
Jérôme Schneider 2013-08-24 22:29:19 +02:00
parent 8644d8943f
commit aef2981e05

View file

@ -45,6 +45,10 @@ class Tools extends \Flake\Core\FLObject {
}
public static function getCurrentProtocol() {
if(isset($GLOBALS['_SERVER']['HTTP_X_FORWARDED_PROTO']) && !empty($GLOBALS['_SERVER']['HTTP_X_FORWARDED_PROTO'])) {
return $GLOBALS['_SERVER']['HTTP_X_FORWARDED_PROTO'];
}
if((!empty($GLOBALS["_SERVER"]["HTTPS"]) && $GLOBALS["_SERVER"]['HTTPS'] !== 'off') || intval($_SERVER['SERVER_PORT']) === 443) {
return "https";
}
@ -761,4 +765,4 @@ TEST;
}
return $data;
}
}
}