Fix iLike() falsely turning escaped % and _ into wildcards

Signed-off-by: Joas Schilling <coding@schilljs.com>
This commit is contained in:
Joas Schilling 2020-11-06 15:31:28 +01:00 committed by backportbot[bot]
parent b1efe1896b
commit d5dfaf42a8
1 changed files with 1 additions and 3 deletions

View File

@ -185,8 +185,6 @@ class OCIExpressionBuilder extends ExpressionBuilder {
* @inheritdoc * @inheritdoc
*/ */
public function iLike($x, $y, $type = null) { public function iLike($x, $y, $type = null) {
$x = $this->helper->quoteColumnName($x); return $this->like($this->functionBuilder->lower($x), $this->functionBuilder->lower($y));
$y = $this->helper->quoteColumnName($y);
return new QueryFunction('REGEXP_LIKE(' . $x . ', \'^\' || REPLACE(REPLACE(' . $y . ', \'%\', \'.*\'), \'_\', \'.\') || \'$\', \'i\')');
} }
} }