From 0ae7bd19f00a8737b8f212e7b6b47f0f5adf8a16 Mon Sep 17 00:00:00 2001 From: Luke Bratch Date: Sun, 22 Nov 2015 21:16:44 +0000 Subject: Make redirects and hyperlinks respect whether or not HTTPS is being used --- index.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/index.php b/index.php index d518bbc..e00f42a 100644 --- a/index.php +++ b/index.php @@ -3,6 +3,13 @@ include('config.php'); $signout = 'Sign out'; +// 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 { -- cgit v1.2.3