// 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);
}
}