trim white space when checking dedupe
authorPradeep Nayak <pradpnayak@gmail.com>
Sat, 22 Aug 2020 13:06:48 +0000 (14:06 +0100)
committerPradeep Nayak <pradpnayak@gmail.com>
Sat, 22 Aug 2020 13:06:48 +0000 (14:06 +0100)
CRM/Dedupe/BAO/Rule.php

index 0c40a52c58b61d03cf02092828c5e22065eeb1a5..b695d18b6e95f586d5962a949a698520874510a8 100644 (file)
@@ -136,7 +136,7 @@ class CRM_Dedupe_BAO_Rule extends CRM_Dedupe_DAO_Rule {
       $from = "{$this->rule_table} t1";
       $str = 'NULL';
       if (isset($this->params[$this->rule_table][$this->rule_field])) {
-        $str = CRM_Utils_Type::escape($this->params[$this->rule_table][$this->rule_field], 'String');
+        $str = trim(CRM_Utils_Type::escape($this->params[$this->rule_table][$this->rule_field], 'String'));
       }
       if ($this->rule_length) {
         $where[] = "SUBSTR(t1.{$this->rule_field}, 1, {$this->rule_length}) = SUBSTR('$str', 1, {$this->rule_length})";