diff --git a/src/Controller/AdminController.php b/src/Controller/AdminController.php index 7314439..f2ed369 100644 --- a/src/Controller/AdminController.php +++ b/src/Controller/AdminController.php @@ -20,6 +20,7 @@ use AdvancedObjectSearchBundle\Model\SavedSearch; use AdvancedObjectSearchBundle\Service; use Pimcore\Bundle\AdminBundle\Helper\QueryParams; +use Pimcore\Db; use Pimcore\Model\DataObject; use Pimcore\Tool; use Symfony\Component\EventDispatcher\EventDispatcherInterface; @@ -313,6 +314,7 @@ public function findAction(Request $request) $offset = $offset ? $offset : 0; $limit = $limit ? $limit : 50; + $db = Db::get(); $searcherList = new SavedSearch\Listing(); $conditionParts = []; $conditionParams = []; @@ -327,7 +329,11 @@ public function findAction(Request $request) //filter for query if (!empty($query)) { - $conditionParts[] = '(name LIKE ? OR description LIKE ? OR category LIKE ?)'; + $conditionParts[] = sprintf('(%s LIKE ? OR %s LIKE ? OR %s LIKE ?)', + $db->quoteIdentifier('name'), + $db->quoteIdentifier('description'), + $db->quoteIdentifier('category') + ); $conditionParams[] = '%' . $query . '%'; $conditionParams[] = '%' . $query . '%'; $conditionParams[] = '%' . $query . '%';