minor fix
[civicrm-core.git] / CRM / Event / BAO / Query.php
index 6f34f0476b36eb901559c4c6ab4d366fbd8b960e..a64a77487072a2d816c5544845362d9959b25c57 100644 (file)
@@ -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');
             }
           }
         }