Skip to content

Commit 1bf87b2

Browse files
authored
fix: prevent double https in normalizeUrl (#369)
1 parent 6ab53d6 commit 1bf87b2

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

modules/48-conditionals/40-if-else/index.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,10 @@
55
// BEGIN
66
function normalizeUrl($url)
77
{
8+
if (strpos($url, 'https://') === 0) {
9+
return $url;
10+
}
11+
812
if (strpos($url, 'http://') === 0) {
913
$domain = substr($url, 7);
1014
} else {
@@ -13,4 +17,5 @@ function normalizeUrl($url)
1317

1418
return "https://{$domain}";
1519
}
20+
1621
// END

0 commit comments

Comments
 (0)