Unverified Commit 2fe01df9 authored by Eileen McNaughton's avatar Eileen McNaughton Committed by GitHub

Merge pull request #15275 from eileenmcnaughton/email

Trim form values when adding LIKE operator
parents 91ae8b42 00ed17db
......@@ -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]))];
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment