Skip to content

Commit 52b8db4

Browse files
authored
Merge pull request #631 from leigh-ols/leigh-ols-patch-2
Fix issue where orderBy strips spaces from fieldname
2 parents 158eec4 + 106ff47 commit 52b8db4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

MysqliDb.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1093,7 +1093,7 @@ public function orderBy($orderByField, $orderbyDirection = "DESC", $customFields
10931093
{
10941094
$allowedDirection = Array("ASC", "DESC");
10951095
$orderbyDirection = strtoupper(trim($orderbyDirection));
1096-
$orderByField = preg_replace("/[^-a-z0-9\.\(\),_`\*\'\"]+/i", '', $orderByField);
1096+
$orderByField = preg_replace("/[^ -a-z0-9\.\(\),_`\*\'\"]+/i", '', $orderByField);
10971097

10981098
// Add table prefix to orderByField if needed.
10991099
//FIXME: We are adding prefix only if table is enclosed into `` to distinguish aliases

0 commit comments

Comments
 (0)