From 5e48b3f7f7116996fcdfe8d533e2e3e171d0c5ba Mon Sep 17 00:00:00 2001 From: andofrjando Date: Sat, 16 Sep 2017 11:24:38 +0800 Subject: [PATCH] Fix one mistake where `$proto` would not be created if `$_SERVER['HTTPS']` exists but is not set to `on` --- advanced/index.php | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/advanced/index.php b/advanced/index.php index 5e88a050..62b861dc 100644 --- a/advanced/index.php +++ b/advanced/index.php @@ -41,12 +41,10 @@ $validExtTypes = array("asp", "htm", "html", "php", "rss", "xml", ""); $currentUrlExt = pathinfo($_SERVER["REQUEST_URI"], PATHINFO_EXTENSION); // Check if this is served over HTTP or HTTPS -if(isset($_SERVER['HTTPS'])) { - if ($_SERVER['HTTPS'] == "on") { - $proto = "https"; - } else { - $proto = "http"; - } +if(isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] == "on") { + $proto = "https"; +} else { + $proto = "http"; } // Set mobile friendly viewport