From e33b80cbfa7e8e84a8077b2af853ad82c0beb4b7 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Thu, 27 Aug 2015 10:44:19 +0530 Subject: [PATCH] minor fix --- CRM/Event/BAO/Query.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CRM/Event/BAO/Query.php b/CRM/Event/BAO/Query.php index 6f34f0476b..a64a774870 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -383,9 +383,10 @@ class CRM_Event_BAO_Query { $op = key($value); $value = $value[$op]; } - if (!strstr($op, 'NULL') || !strstr($op, 'EMPTY')) { + if (!strstr($op, 'NULL') && !strstr($op, 'EMPTY') && !strstr($op, 'LIKE')) { $regexOp = (strstr($op, '!') || strstr($op, 'NOT')) ? 'NOT REGEXP' : 'REGEXP'; - $query->_where[$grouping][] = " civicrm_participant.$name $regexOp '^" . implode('[[:cntrl:]]', (array) $value) . "$' "; + $regexp = (strstr($op, '=')) ? "^{$value}$" : "[[:cntrl:]]*" . implode('[[:>:]]*|[[:<:]]*', (array) $value) . "[[:cntrl:]]*"; + $query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("civicrm_participant.$name", $regexOp, $regexp, 'String'); } } } -- 2.25.1