diff --git a/lib/functions.php b/lib/functions.php
index 85bfd5e778b67572c9d619b8334b006b7974bc04..96dd9551731d1b750b9212aa9460f8b397a44d46 100644
--- a/lib/functions.php
+++ b/lib/functions.php
@@ -1816,12 +1816,8 @@ function get_default_http_stream_context($url = '')
         }
         $host = $purl['host'];
         $whitelist = array_filter(array_map('trim', explode(',', Config::get()->HTTP_PROXY_IGNORE)));
-
-        foreach ($whitelist as $whitehost) {
-            if (fnmatch($whitehost, $host)) {
-                $proxy = '';
-                break;
-            }
+        if (in_array($host, $whitelist)) {
+            $proxy = '';
         }
     }
     if ($proxy) {