Skip to content

Commit

Permalink
handle multi-line expression in unchecked OrderBy
Browse files Browse the repository at this point in the history
  • Loading branch information
Lekkimone92 committed Oct 8, 2020
1 parent 5a7bb2e commit 1866466
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/OrderByAnalyzer.php
Expand Up @@ -131,7 +131,7 @@ private function analyzeOrderByNoCache(string $orderBy) : array
*/
private function trimDirection(string $sql) : string
{
preg_match('/^(.*)(\s+(DESC|ASC|))*$/Ui', $sql, $matches);
preg_match('/^((.|\n)*)(\s+(DESC|ASC|))$/Ui', $sql, $matches);

return $matches[1];
}
Expand Down

0 comments on commit 1866466

Please sign in to comment.