Skip to content

Instantly share code, notes, and snippets.

@monishdeb
Created August 4, 2015 10:16
Show Gist options
  • Save monishdeb/fc12dd9f7963b4e5d2cf to your computer and use it in GitHub Desktop.
Save monishdeb/fc12dd9f7963b4e5d2cf to your computer and use it in GitHub Desktop.
diff --git a/CRM/Core/BAO/CustomQuery.php b/CRM/Core/BAO/CustomQuery.php
index 37b00ab..7514a13 100644
--- a/CRM/Core/BAO/CustomQuery.php
+++ b/CRM/Core/BAO/CustomQuery.php
@@ -424,12 +424,12 @@ SELECT label, value
// CRM-14563,CRM-16575 : Special handling of multi-select custom fields
if ($isSerialized && !empty($value)) {
if (strstr($op, 'IN')) {
- $value = str_replace(array('(', ')'), '', str_replace(",", "[[:cntrl:]]|[[:cntrl:]]", $value));
+ $value = str_replace(",", "[[:cntrl:]]*|[[:cntrl:]]*", $value);
}
$op = (strstr($op, '!') || strstr($op, 'NOT')) ? 'NOT RLIKE' : 'RLIKE';
- $value = "[[:cntrl:]]" . $value . "[[:cntrl:]]";
+ $value = "[[:cntrl:]]*" . $value . "[[:cntrl:]]*";
if (!$wildcard) {
- $value = str_replace("[[:cntrl:]]|", '', $value);
+ $value = str_replace("[[:cntrl:]]*|", '', $value);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment