Last active
August 29, 2015 14:13
-
-
Save larsmqller/d0886ec2e38c45f78cfe to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
Check if protocol is https | |
Nb: port 443 does not guarantee connection is encrypted | |
http://stackoverflow.com/questions/1175096/how-to-find-out-if-you-are-using-https-without-serverhttps#answer-2886224 | |
*/ | |
function isSecure() { | |
return | |
(!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') | |
|| $_SERVER['SERVER_PORT'] == 443; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment