From 00ed17dbb1470cbb429f2120c640305a1498b891 Mon Sep 17 00:00:00 2001 From: eileen Date: Wed, 11 Sep 2019 13:33:36 +1200 Subject: [PATCH] Trim form values when adding LIKE operator This is more consistent with previous behaviour - ie 'info@civicrm.org' AND 'info@civicrm.org ' should work. --- CRM/Core/Form/Search.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CRM/Core/Form/Search.php b/CRM/Core/Form/Search.php index 919f43848c..7fab1da759 100644 --- a/CRM/Core/Form/Search.php +++ b/CRM/Core/Form/Search.php @@ -321,7 +321,7 @@ class CRM_Core_Form_Search extends CRM_Core_Form { foreach ($fields as $fieldName => $field) { if (!empty($this->_formValues[$fieldName]) && empty($field['options']) && empty($field['pseudoconstant'])) { if (in_array($field['type'], [CRM_Utils_Type::T_STRING, CRM_Utils_Type::T_TEXT])) { - $this->_formValues[$fieldName] = ['LIKE' => CRM_Contact_BAO_Query::getWildCardedValue(TRUE, 'LIKE', $this->_formValues[$fieldName])]; + $this->_formValues[$fieldName] = ['LIKE' => CRM_Contact_BAO_Query::getWildCardedValue(TRUE, 'LIKE', trim($this->_formValues[$fieldName]))]; } } } -- 2.25.1