Skip to content

Commit 44abf40

Browse files
committed
Escape special characters in Varnish::banPath() host patterns
1 parent eed7738 commit 44abf40

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ProxyClient/Varnish.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ public function banPath(string $path, ?string $contentType = null, array|string|
110110
if (!count($hosts)) {
111111
throw new InvalidArgumentException('Either supply a list of hosts or null, but not an empty array.');
112112
}
113-
$hosts = '^('.implode('|', $hosts).')$';
113+
$hosts = '^('.implode('|', array_map('preg_quote', $hosts)).')$';
114114
}
115115

116116
$headers = [

0 commit comments

Comments
 (0)