Skip to content

Commit 4609810

Browse files
committed
force_https didn’t force https
when https:// is present in a defined base URL and a user accesses the site on on an insecure protocol, it would not force them onto secure.
1 parent 6ad591a commit 4609810

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

system/Common.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -447,13 +447,11 @@ function force_https(int $duration = 31536000, RequestInterface $request = null,
447447

448448
$baseURL = config(App::class)->baseURL;
449449

450-
// If we already use 'https' then return immediately
451450
if (strpos($baseURL, 'https://') === 0)
452451
{
453-
return;
452+
$baseURL = (string) substr($baseURL, strlen('https://'));
454453
}
455-
456-
if (strpos($baseURL, 'http://') === 0)
454+
else if (strpos($baseURL, 'http://') === 0)
457455
{
458456
$baseURL = (string) substr($baseURL, strlen('http://'));
459457
}

0 commit comments

Comments
 (0)