Skip to content

Commit 70a3686

Browse files
committed
Merge pull request #318 from avbdr/master
Added * as a valid char for orderBy and groupBy
2 parents 8041c0f + a6d5f13 commit 70a3686

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
@@ -713,7 +713,7 @@ public function orderBy($orderByField, $orderbyDirection = "DESC", $customFields
713713
{
714714
$allowedDirection = Array ("ASC", "DESC");
715715
$orderbyDirection = strtoupper (trim ($orderbyDirection));
716-
$orderByField = preg_replace ("/[^-a-z0-9\.\(\),_`]+/i",'', $orderByField);
716+
$orderByField = preg_replace ("/[^-a-z0-9\.\(\),_`\*]+/i",'', $orderByField);
717717

718718
// Add table prefix to orderByField if needed.
719719
//FIXME: We are adding prefix only if table is enclosed into `` to distinguish aliases
@@ -746,7 +746,7 @@ public function orderBy($orderByField, $orderbyDirection = "DESC", $customFields
746746
*/
747747
public function groupBy($groupByField)
748748
{
749-
$groupByField = preg_replace ("/[^-a-z0-9\.\(\),_]+/i",'', $groupByField);
749+
$groupByField = preg_replace ("/[^-a-z0-9\.\(\),_\*]+/i",'', $groupByField);
750750

751751
$this->_groupBy[] = $groupByField;
752752
return $this;

0 commit comments

Comments
 (0)