From ec20fa61634a36c2ec80d30f2d02001dcfa738d4 Mon Sep 17 00:00:00 2001
From: David Siegfried <david.siegfried@uni-vechta.de>
Date: Mon, 2 May 2022 08:47:10 +0000
Subject: [PATCH] added wildcard support to HTTP_PROXY_IGNORE, fixes #582

Closes #582
---
 lib/functions.php | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

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