Skip to content

Commit ba234f1

Browse files
committed
Values escaped before being turned into a regex in UniqueDocumentValidator (imported from: mandango/MandangoBundle#13)
1 parent f83e028 commit ba234f1

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

Validator/Constraint/UniqueDocumentValidator.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ private function createCriteria(Document $document, array $fields, array $caseIn
128128
foreach ($fields as $field) {
129129
$value = $document->get($field);
130130
if (in_array($field, $caseInsensitive)) {
131-
$value = new \MongoRegex(sprintf('/^%s$/i', $value));
131+
$value = new \MongoRegex(sprintf('/^%s$/i', preg_quote($value)));
132132
}
133133
$criteria[$field] = $value;
134134
}

0 commit comments

Comments
 (0)