From 228753d309f06b7b73b3446207fc757de6d20f56 Mon Sep 17 00:00:00 2001 From: jitendrapurohit Date: Fri, 1 Jul 2016 11:20:12 +0530 Subject: [PATCH] CRM-18803 - CiviReports REGEXP incorrectly filters selected values --- CRM/Report/Form.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Report/Form.php b/CRM/Report/Form.php index e3f7c7857f..0331ddc3ff 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -1883,7 +1883,7 @@ class CRM_Report_Form extends CRM_Core_Form { if ($value !== NULL && count($value) > 0) { $value = CRM_Utils_Type::escapeAll($value, $type); $operator = $op == 'mnot' ? 'NOT' : ''; - $regexp = "[[:cntrl:]]*" . implode('[[:>:]]*|[[:<:]]*', (array) $value) . "[[:cntrl:]]*"; + $regexp = "([[:cntrl:]]|^)" . implode('([[:cntrl:]]|$)|([[:cntrl:]]|^)', (array) $value) . "([[:cntrl:]]|$)"; $clause = "{$field['dbAlias']} {$operator} REGEXP '{$regexp}'"; } break; -- 2.25.1