diff --git a/system/Common.php b/system/Common.php index 348826263c38..22dd4135162e 100644 --- a/system/Common.php +++ b/system/Common.php @@ -447,13 +447,11 @@ function force_https(int $duration = 31536000, RequestInterface $request = null, $baseURL = config(App::class)->baseURL; - // If we already use 'https' then return immediately if (strpos($baseURL, 'https://') === 0) { - return; + $baseURL = (string) substr($baseURL, strlen('https://')); } - - if (strpos($baseURL, 'http://') === 0) + elseif (strpos($baseURL, 'http://') === 0) { $baseURL = (string) substr($baseURL, strlen('http://')); }