Merge pull request #24048 from nextcloud/backport/23943/stable19

[stable19] Fix iLike() falsely turning escaped % and _ into wildcards
This commit is contained in:
Roeland Jago Douma 2020-11-11 21:53:24 +01:00 committed by GitHub
commit 0f5ac14f43
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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\')');
} }
} }