From: Jon Goldberg Date: Thu, 21 Nov 2019 18:32:56 +0000 (-0500) Subject: core#1411: Advanced Search crashes when some form values start with 1 X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=94a33a7a439338a72867ccbee03e8a87a74fea29;p=civicrm-core.git core#1411: Advanced Search crashes when some form values start with 1 --- diff --git a/CRM/Contact/Selector.php b/CRM/Contact/Selector.php index 1e9a3b0ee5..faf4e64e2d 100644 --- a/CRM/Contact/Selector.php +++ b/CRM/Contact/Selector.php @@ -1039,11 +1039,11 @@ class CRM_Contact_Selector extends CRM_Core_Selector_Base implements CRM_Core_Se // the other alternative of running the FULL query will just be incredibly inefficient // and slow things down way too much on large data sets / complex queries - $selectSQL = "SELECT DISTINCT %1, contact_a.id, contact_a.sort_name"; + $selectSQL = CRM_Core_DAO::composeQuery("SELECT DISTINCT %1, contact_a.id, contact_a.sort_name", [1 => [$cacheKey, 'String']]); $sql = str_ireplace(["SELECT contact_a.id as contact_id", "SELECT contact_a.id as id"], $selectSQL, $sql); try { - Civi::service('prevnext')->fillWithSql($cacheKey, $sql, [1 => [$cacheKey, 'String']]); + Civi::service('prevnext')->fillWithSql($cacheKey, $sql); } catch (CRM_Core_Exception $e) { if ($coreSearch) {