]> git.mxchange.org Git - friendica.git/commitdiff
Fix notice in Util\Network
authorHypolite Petovan <mrpetovan@gmail.com>
Wed, 18 Jul 2018 01:00:22 +0000 (21:00 -0400)
committerHypolite Petovan <mrpetovan@gmail.com>
Wed, 18 Jul 2018 01:00:22 +0000 (21:00 -0400)
src/Util/Network.php

index 0e65145b78340caca37bc49f583a9d62c441df0e..aa118e3dd4fedb3158aaef28c97c66a30e52ec8d 100644 (file)
@@ -559,9 +559,8 @@ class Network
         */
        public static function isUrlBlocked($url)
        {
-               $h = @parse_url($url);
-
-               if (! $h) {
+               $host = @parse_url($url, PHP_URL_HOST);
+               if (! $host) {
                        return true;
                }
 
@@ -570,10 +569,8 @@ class Network
                        return false;
                }
 
-               $host = strtolower($h['host']);
-
                foreach ($domain_blocklist as $domain_block) {
-                       if (strtolower($domain_block['domain']) == $host) {
+                       if (strcasecmp($domain_block['domain'], $host) === 0) {
                                return true;
                        }
                }