Skip to content

Commit 39d06d9

Browse files
Bjarne Restavbdr
Bjarne Rest
authored andcommitted
Fixed groupBy with spaces in field declaration (#683)
* Fixed groupBy with saces in field declaration Sometimes you have to use GROUP BY in SQL with Spaces in it. The old implementation deleted all spaces in $groupByField Eg "IF(qv.idValue IS NULL, UUID(), qv.idValue)" would become "IF(qv.idValueISNULL,UUID(),qv.idValue)" * Addes operators <>=! to groupBy
1 parent 6e13d5a commit 39d06d9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MysqliDb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1194,7 +1194,7 @@ public function orderBy($orderByField, $orderbyDirection = "DESC", $customFields
11941194
*/
11951195
public function groupBy($groupByField)
11961196
{
1197-
$groupByField = preg_replace("/[^-a-z0-9\.\(\),_\*]+/i", '', $groupByField);
1197+
$groupByField = preg_replace("/[^-a-z0-9\.\(\),_\* <>=!]+/i", '', $groupByField);
11981198

11991199
$this->_groupBy[] = $groupByField;
12001200
return $this;

0 commit comments

Comments
 (0)