Skip to content

Commit

Permalink
Strtolower fix 'name'
Browse files Browse the repository at this point in the history
  • Loading branch information
eileenmcnaughton committed Oct 29, 2018
1 parent 40b45f2 commit 2bde57c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions CRM/Contact/BAO/Query.php
Original file line number Diff line number Diff line change
Expand Up @@ -2212,14 +2212,15 @@ public function restWhere(&$values) {
}
}
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') {
Expand Down

0 comments on commit 2bde57c

Please sign in to comment.