From: jitendrapurohit Date: Fri, 1 Jul 2016 05:50:12 +0000 (+0530) Subject: CRM-18803 - CiviReports REGEXP incorrectly filters selected values X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=228753d309f06b7b73b3446207fc757de6d20f56;p=civicrm-core.git CRM-18803 - CiviReports REGEXP incorrectly filters selected values --- 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;