From: Patrick Canterino Date: Thu, 27 Apr 2023 18:17:07 +0000 (+0200) Subject: Provide URL scheme in installer X-Git-Tag: 4.6.0~14^2~13 X-Git-Url: https://git.p6c8.net/jirafeau_project.git/commitdiff_plain/76672f43452be5fb86ed140cc15b43c786cd75c2 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)