Skip to content

Commit

Permalink
Improve handling of case in attribute mappings (CO-1778)
Browse files Browse the repository at this point in the history
  • Loading branch information
Benn Oshrin committed Jul 23, 2019
1 parent 7498f51 commit 29c027b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions app/src/Lib/Match/MatchService.php
Original file line number Diff line number Diff line change
Expand Up @@ -515,14 +515,15 @@ protected function search(string $mode,
$andclause = $colclause . "=?";
break;
case SearchTypeEnum::Mapping:
$qclause = (!$ruleattr->attribute->case_sensitive ? "LOWER(query)" : "query");
$andclause = "(" . $colclause . "
IN (SELECT value
FROM attribute_mappings
WHERE attribute_map_id=" . $ruleattr->attribute->attribute_map_id ."
AND query=LOWER(?))
AND " . $qclause . "=?)
OR " . $colclause . "=?)";
// We need to copies of $val in the param list
$vals[] = $val;
// We need two copies of $val in the param list
$vals[] = (!$ruleattr->attribute->case_sensitive ? strtolower($val) : $val);
break;
case SearchTypeEnum::Substring:
$andclause = "SUBSTRING("
Expand Down

0 comments on commit 29c027b

Please sign in to comment.