From ce59cdbcd9e2adead588d679337bfb4d65e8425c Mon Sep 17 00:00:00 2001 From: Wim Molenberghs Date: Mon, 6 Mar 2023 08:19:58 +0100 Subject: [PATCH] Update DataTablesRepositoryTrait.php Escape special characters in regex string --- src/Doctrine/ODM/DataTablesRepositoryTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Doctrine/ODM/DataTablesRepositoryTrait.php b/src/Doctrine/ODM/DataTablesRepositoryTrait.php index 8aba7a9..0c3e3e2 100644 --- a/src/Doctrine/ODM/DataTablesRepositoryTrait.php +++ b/src/Doctrine/ODM/DataTablesRepositoryTrait.php @@ -104,7 +104,7 @@ private function addSearch(Parameters $parameters, Columns $columns, Builder $qb return; } - $searchString = $parameters->getSearchString(); + $searchString = preg_quote($parameters->getSearchString()); $expression = $qb->expr();