From: monishdeb Date: Wed, 21 Oct 2015 07:57:45 +0000 (+0530) Subject: minor fix X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=2b6760c5e7b738d3e213f8e7aee879984d1ab569;p=civicrm-core.git minor fix --- diff --git a/CRM/Contact/Form/Search/Advanced.php b/CRM/Contact/Form/Search/Advanced.php index 9b62331ffb..502da90f05 100644 --- a/CRM/Contact/Form/Search/Advanced.php +++ b/CRM/Contact/Form/Search/Advanced.php @@ -360,7 +360,7 @@ class CRM_Contact_Form_Search_Advanced extends CRM_Contact_Form_Search { } $this->_formValues[$element] = array('IN' => $value); } - elseif ((substr($value, 0, 1) == '%') || (substr($value, -1, 1) == '%')) { + elseif (strstr($value, '%')) { $this->_formValues[$element] = array('LIKE' => $value); } } diff --git a/CRM/Core/BAO/CustomValue.php b/CRM/Core/BAO/CustomValue.php index 557e4ab3a0..482a173581 100644 --- a/CRM/Core/BAO/CustomValue.php +++ b/CRM/Core/BAO/CustomValue.php @@ -188,10 +188,7 @@ class CRM_Core_BAO_CustomValue extends CRM_Core_DAO { } elseif (($htmlType == 'TextArea' || ($htmlType == 'Text' && $dataType == 'String') - ) && - ((substr($formValues[$key], 0, 1) == '%') || - (substr($formValues[$key], -1, 1) == '%') - ) + ) && strstr($formValues[$key], '%') ) { $formValues[$key] = array('LIKE' => $formValues[$key]); }