From 0d1d8f4aaf2cbdd82c9e445c8d9ce7f49c56729f 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 1b6b0fddc0..cdfd11a05c 100644 --- a/CRM/Event/BAO/Query.php +++ b/CRM/Event/BAO/Query.php @@ -380,9 +380,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