diff --git a/MysqliDb.php b/MysqliDb.php index 19d3d55b..a90e2805 100644 --- a/MysqliDb.php +++ b/MysqliDb.php @@ -1093,7 +1093,7 @@ public function orderBy($orderByField, $orderbyDirection = "DESC", $customFields { $allowedDirection = Array("ASC", "DESC"); $orderbyDirection = strtoupper(trim($orderbyDirection)); - $orderByField = preg_replace("/[^-a-z0-9\.\(\),_`\*\'\"]+/i", '', $orderByField); + $orderByField = preg_replace("/[^ -a-z0-9\.\(\),_`\*\'\"]+/i", '', $orderByField); // Add table prefix to orderByField if needed. //FIXME: We are adding prefix only if table is enclosed into `` to distinguish aliases