From: Michael Date: Sun, 3 Apr 2022 07:31:42 +0000 (+0000) Subject: Improved handling of invalid links X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=5290f0cd512ee42ff2bce35e3ede0b0ca01e24e4;p=friendica.git Improved handling of invalid links --- diff --git a/src/Util/Network.php b/src/Util/Network.php index 492d0ecac7..7e72404287 100644 --- a/src/Util/Network.php +++ b/src/Util/Network.php @@ -569,6 +569,7 @@ class Network */ public static function isValidHttpUrl(string $url) { - return in_array(parse_url($url, PHP_URL_SCHEME), ['http', 'https']) && parse_url($url, PHP_URL_HOST); + $scheme = parse_url($url, PHP_URL_SCHEME); + return !empty($scheme) && in_array($scheme, ['http', 'https']) && parse_url($url, PHP_URL_HOST); } }