Skip to content

Commit b9a5c77

Browse files
committed
Allow Underscore char in orderBy/groupBy filter as its a legit symbol in names
1 parent 58938e2 commit b9a5c77

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

MysqliDb.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public function orderBy($orderByField, $orderbyDirection = "DESC")
339339
{
340340
$allowedDirection = Array ("ASC", "DESC");
341341
$orderbyDirection = strtoupper (trim ($orderbyDirection));
342-
$orderByField = preg_replace ("/[^-a-z0-9\.\(\),]+/i",'', $orderByField);
342+
$orderByField = preg_replace ("/[^-a-z0-9\.\(\),_]+/i",'', $orderByField);
343343

344344
if (empty($orderbyDirection) || !in_array ($orderbyDirection, $allowedDirection))
345345
die ('Wrong order direction: '.$orderbyDirection);
@@ -359,7 +359,7 @@ public function orderBy($orderByField, $orderbyDirection = "DESC")
359359
*/
360360
public function groupBy($groupByField)
361361
{
362-
$groupByField = preg_replace ("/[^-a-z0-9\.\(\),]+/i",'', $groupByField);
362+
$groupByField = preg_replace ("/[^-a-z0-9\.\(\),_]+/i",'', $groupByField);
363363

364364
$this->_groupBy[] = $groupByField;
365365
return $this;

0 commit comments

Comments
 (0)