1
0

Check if $_SERVER['HTTPS'] is set

This commit is contained in:
Aaron Lindsay 2014-01-23 23:32:15 -05:00
parent 5bc0e638cf
commit ce5e42b6b4

View File

@ -1,8 +1,9 @@
<?php
function get_protocol() {
$protocol = "http";
if ( (!empty($_SERVER['HTTPS'] && $_SERVER['HTTPS'] !== 'off') ||
$_SERVER['SERVER_PORT'] == 443) )
if ( (isset($_SERVER['HTTPS']) && !empty($_SERVER['HTTPS']
&& $_SERVER['HTTPS'] !== 'off') ||
$_SERVER['SERVER_PORT'] == 443) )
$protocol = "https";
return $protocol."://";
}