Skip to content

Commit fe8fb79

Browse files
committed
Merge pull request #336 from avbdr/master
Allow " and ' chars in orderBy
2 parents bf23579 + 8d53d6a commit fe8fb79

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

MysqliDb.php

+4-2
Original file line numberDiff line numberDiff line change
@@ -714,7 +714,7 @@ public function orderBy($orderByField, $orderbyDirection = "DESC", $customFields
714714
{
715715
$allowedDirection = Array ("ASC", "DESC");
716716
$orderbyDirection = strtoupper (trim ($orderbyDirection));
717-
$orderByField = preg_replace ("/[^-a-z0-9\.\(\),_`\*]+/i",'', $orderByField);
717+
$orderByField = preg_replace ("/[^-a-z0-9\.\(\),_`\*\'\"]+/i",'', $orderByField);
718718

719719
// Add table prefix to orderByField if needed.
720720
//FIXME: We are adding prefix only if table is enclosed into `` to distinguish aliases
@@ -1240,8 +1240,10 @@ public function __destruct()
12401240
{
12411241
if ($this->isSubQuery)
12421242
return;
1243-
if ($this->_mysqli)
1243+
if ($this->_mysqli) {
12441244
$this->_mysqli->close();
1245+
$this->_mysqli = null;
1246+
}
12451247
}
12461248

12471249
/**

0 commit comments

Comments
 (0)