diff options
author | Luke Bratch <luke@bratch.co.uk> | 2015-11-22 21:16:44 +0000 |
---|---|---|
committer | Luke Bratch <luke@bratch.co.uk> | 2015-11-22 21:16:44 +0000 |
commit | 0ae7bd19f00a8737b8f212e7b6b47f0f5adf8a16 (patch) | |
tree | d26f3965093b4f5d10c03a006cbbb14c1cbc3d5b | |
parent | ee66f2046089f2dce3d84185a3807f2711319d66 (diff) |
Make redirects and hyperlinks respect whether or not HTTPS is being used
-rw-r--r-- | index.php | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -3,6 +3,13 @@ include('config.php'); $signout = '<a href="' . basename($_SERVER['PHP_SELF']) . '?signout">Sign out</a>'; +// Respect HTTPS or not +if (isset($_SERVER['HTTPS'])) { + $url = preg_replace("/^http:\/\//", "https://", $url); +} else { + $url = preg_replace("/^https:\/\//", "http://", $url); +} + if (isset($_GET) && count($_GET) > 0) { $getstring = "?" . http_build_query($_GET); } else { |