* @todo Test more fields
*/
public static function isHttpSecured () {
- return (isset($_SERVER['HTTPS']));
+ return (
+ (
+ (
+ isset($_SERVER['HTTPS'])
+ ) && (
+ strtolower($_SERVER['HTTPS']) == 'on'
+ )
+ ) || (
+ (
+ isset($_SERVER['HTTP_X_FORWARDED_PROTO'])
+ ) && (
+ strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) == 'https'
+ )
+ )
+ );
}
/**