Skip to content

Commit 8d53d6a

Browse files
committed
Allow " and ' chars in orderBy
1 parent 12c0a1d commit 8d53d6a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

MysqliDb.php

Lines changed: 4 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
@@ -1239,8 +1239,10 @@ public function __destruct()
12391239
{
12401240
if ($this->isSubQuery)
12411241
return;
1242-
if ($this->_mysqli)
1242+
if ($this->_mysqli) {
12431243
$this->_mysqli->close();
1244+
$this->_mysqli = null;
1245+
}
12441246
}
12451247

12461248
/**

0 commit comments

Comments
 (0)