Skip to content

Commit c66408b

Browse files
authored
handle multi-line expression in unchecked OrderBy (#233)
* handle multi-line expression in unchecked OrderBy
1 parent 5a7bb2e commit c66408b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/OrderByAnalyzer.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ private function analyzeOrderByNoCache(string $orderBy) : array
131131
*/
132132
private function trimDirection(string $sql) : string
133133
{
134-
preg_match('/^(.*)(\s+(DESC|ASC|))*$/Ui', $sql, $matches);
134+
preg_match('/^((.|\n)*)(\s+(DESC|ASC))?$/Ui', $sql, $matches);
135135

136136
return $matches[1];
137137
}

0 commit comments

Comments
 (0)