From 2b6760c5e7b738d3e213f8e7aee879984d1ab569 Mon Sep 17 00:00:00 2001 From: monishdeb Date: Wed, 21 Oct 2015 13:27:45 +0530 Subject: [PATCH] minor fix --- CRM/Contact/Form/Search/Advanced.php | 2 +- CRM/Core/BAO/CustomValue.php | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) 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]); } -- 2.25.1