From e7db53bad9a5499fa20ff66e97b2f1f3d27f5fdc Mon Sep 17 00:00:00 2001 From: omar abu hussein Date: Wed, 23 Nov 2016 22:21:39 +0200 Subject: [PATCH] CRM-16575: Fixing custom field search issue for reports --- 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 8a54de487b..04da132412 100644 --- a/CRM/Report/Form.php +++ b/CRM/Report/Form.php @@ -1742,7 +1742,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