From: monishdeb Date: Wed, 5 Aug 2015 11:45:41 +0000 (+0530) Subject: traditional way to fix by using special character in RLIKE X-Git-Url: https://vcs.fsf.org/?a=commitdiff_plain;h=92eac77dc25a3a3b6dbe4f0d3ab757bbe9eaece0;p=civicrm-core.git traditional way to fix by using special character in RLIKE --- diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php index 7514a13573..747e07a8e1 100644 --- a/CRM/Core/BAO/CustomQuery.php +++ b/CRM/Core/BAO/CustomQuery.php @@ -423,13 +423,14 @@ SELECT label, value // CRM-14563,CRM-16575 : Special handling of multi-select custom fields if ($isSerialized && !empty($value)) { + $specialChar = '[' . CRM_Core_DAO::VALUE_SEPARATOR . ']*'; if (strstr($op, 'IN')) { - $value = str_replace(",", "[[:cntrl:]]*|[[:cntrl:]]*", $value); + $value = str_replace(",", "$specialChar|$specialChar", $value); } $op = (strstr($op, '!') || strstr($op, 'NOT')) ? 'NOT RLIKE' : 'RLIKE'; - $value = "[[:cntrl:]]*" . $value . "[[:cntrl:]]*"; + $value = "$specialChar$value$specialChar"; if (!$wildcard) { - $value = str_replace("[[:cntrl:]]*|", '', $value); + $value = str_replace("$specialChar|", '', $value); } }