diff --git a/src/ProxyClient/Varnish.php b/src/ProxyClient/Varnish.php index a4b7137e..ab542059 100644 --- a/src/ProxyClient/Varnish.php +++ b/src/ProxyClient/Varnish.php @@ -110,7 +110,7 @@ public function banPath(string $path, ?string $contentType = null, array|string| if (!count($hosts)) { throw new InvalidArgumentException('Either supply a list of hosts or null, but not an empty array.'); } - $hosts = '^('.implode('|', $hosts).')$'; + $hosts = '^('.implode('|', array_map('preg_quote', $hosts)).')$'; } $headers = [