Strtolower fix 'name'
authoreileen <emcnaughton@wikimedia.org>
Mon, 29 Oct 2018 23:09:11 +0000 (12:09 +1300)
committereileen <emcnaughton@wikimedia.org>
Mon, 29 Oct 2018 23:09:11 +0000 (12:09 +1300)
CRM/Contact/BAO/Query.php

index 083b643c5b75dc6fcfdca8c51913009738f929cd..a15a7a71c97ae33a37da763b6fbeef1b33899330 100644 (file)
@@ -2212,14 +2212,15 @@ class CRM_Contact_BAO_Query {
       }
     }
     elseif ($name === 'name') {
-      $value = $strtolower(CRM_Core_DAO::escapeString($value));
+      $value = CRM_Core_DAO::escapeString($value);
       if ($wildcard) {
         $op = 'LIKE';
         $value = self::getWildCardedValue($wildcard, $op, $value);
       }
-      // LOWER roughly translates to 'hurt my database without deriving any benefit' See CRM-19811.
-      $wc = self::caseImportant($op) ? "LOWER({$field['where']})" : "{$field['where']}";
-      $this->_where[$grouping][] = self::buildClause($wc, $op, "'$value'");
+      CRM_Core_Error::deprecatedFunctionWarning('Untested code path');
+      // @todo it's likely this code path is obsolete / never called. It is definitely not
+      // passed through in our test suite.
+      $this->_where[$grouping][] = self::buildClause($field['where'], $op, "'$value'");
       $this->_qill[$grouping][] = "$field[title] $op \"$value\"";
     }
     elseif ($name === 'current_employer') {