Skip to content

Commit 4f702d9

Browse files
committed
Don't append $op if it has not been removed from $k
If getOperator() found an $op, but it is not at the very end of $k, it does not get removed from $k. Previous code was nevertheless appending $op, so it got repeated a second time in the result, which is obviously wrong.
1 parent 9d2f835 commit 4f702d9

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

system/Database/BaseBuilder.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -659,9 +659,11 @@ protected function whereHaving(string $qbKey, $key, $value = null, string $type
659659
$op = trim(current($op));
660660

661661
if (substr($k, -1 * strlen($op)) === $op) {
662-
$k = rtrim(substr($k, 0, -1 * strlen($op)));
662+
$k = rtrim(substr($k, 0, -1 * strlen($op)));
663+
$op = " {$op}";
664+
} else {
665+
$op = '';
663666
}
664-
$op = " {$op}";
665667
} else {
666668
$op = ' =';
667669
}

0 commit comments

Comments
 (0)