From 812b98db7a275dd7ca8e7c33b3f188d8d1a24691 Mon Sep 17 00:00:00 2001 From: lanmanul Date: Mon, 14 Apr 2025 00:06:47 +0300 Subject: [PATCH] fix: prevent double https in normalizeUrl --- modules/48-conditionals/40-if-else/index.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/48-conditionals/40-if-else/index.php b/modules/48-conditionals/40-if-else/index.php index 80714fde..2bb7ff20 100644 --- a/modules/48-conditionals/40-if-else/index.php +++ b/modules/48-conditionals/40-if-else/index.php @@ -5,6 +5,10 @@ // BEGIN function normalizeUrl($url) { + if (strpos($url, 'https://') === 0) { + return $url; + } + if (strpos($url, 'http://') === 0) { $domain = substr($url, 7); } else { @@ -13,4 +17,5 @@ function normalizeUrl($url) return "https://{$domain}"; } + // END