From 22dd22df3c2897186b0407fbd0c9983806f4b95b Mon Sep 17 00:00:00 2001 From: Jan van den Berg Date: Thu, 25 Aug 2022 23:01:33 +0200 Subject: [PATCH] Fix for https://github.com/jan-vandenberg/cruddiy/issues/54 --- core/templates.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/templates.php b/core/templates.php index b8bfe4f..23b3463 100644 --- a/core/templates.php +++ b/core/templates.php @@ -48,12 +48,11 @@ require_once "helpers.php"; //Get current URL and parameters for correct pagination - $protocol = $_SERVER['SERVER_PROTOCOL']; - $domain = $_SERVER['HTTP_HOST']; + $domain = $_SERVER['HTTP_HOST']; $script = $_SERVER['SCRIPT_NAME']; $parameters = $_GET ? $_SERVER['QUERY_STRING'] : "" ; - $protocol=strpos(strtolower($_SERVER['SERVER_PROTOCOL']),'https') === FALSE ? 'http' : 'https'; + $protocol=($_SERVER['HTTPS'] == "on" ? "https" : "http"); $currenturl = $protocol . '://' . $domain. $script . '?' . $parameters; //Pagination