Check if $_SERVER['HTTPS'] is set
This commit is contained in:
parent
5bc0e638cf
commit
ce5e42b6b4
@ -1,8 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
function get_protocol() {
|
function get_protocol() {
|
||||||
$protocol = "http";
|
$protocol = "http";
|
||||||
if ( (!empty($_SERVER['HTTPS'] && $_SERVER['HTTPS'] !== 'off') ||
|
if ( (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']
|
||||||
$_SERVER['SERVER_PORT'] == 443) )
|
&& $_SERVER['HTTPS'] !== 'off') ||
|
||||||
|
$_SERVER['SERVER_PORT'] == 443) )
|
||||||
$protocol = "https";
|
$protocol = "https";
|
||||||
return $protocol."://";
|
return $protocol."://";
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user