Skip to content

Commit 288df37

Browse files
committed
Escape special characters in Varnish::banPath() host patterns
1 parent 4df8da8 commit 288df37

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/ProxyClient/Varnish.php

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

113113
$headers = [

0 commit comments

Comments
 (0)