From: Patrick Canterino Date: Thu, 27 Apr 2023 18:17:07 +0000 (+0200) Subject: Provide URL scheme in installer X-Git-Url: https://git.p6c8.net/jirafeau_mojo42.git/commitdiff_plain/76672f43452be5fb86ed140cc15b43c786cd75c2?ds=sidebyside;hp=6103246a73b77d4264afed927febf5eb4c38dad5 Provide URL scheme in installer --- diff --git a/lib/functions.php b/lib/functions.php index 064d3a1..ecd7be8 100644 --- a/lib/functions.php +++ b/lib/functions.php @@ -1638,7 +1638,8 @@ function jirafeau_add_ending_slash($path) function jirafeau_default_web_root() { - return $_SERVER['HTTP_HOST'] . str_replace('install.php', '', $_SERVER['REQUEST_URI']); + $url_scheme = (isset($_SERVER['HTTPS'])) ? 'https://' : 'http://'; + return $url_scheme . $_SERVER['HTTP_HOST'] . str_replace('install.php', '', $_SERVER['REQUEST_URI']); } function jirafeau_get_download_stats($hash)