mirror of
https://github.com/ebean-orm/ebean.git
synced 2026-11-17 14:55:28 +00:00
#1623 - DbOrderByTrim doesn't remove asc/desc if you're sorting by a function called on a column
This fix removes the word boundary check prior to the blank space for asc and desc (allowing the preceeding char to be a brace or anything)
This commit is contained in:
1 parent
31d7c6fed8
commit
a24e6b6064
2 files changed
+67
-1
No files matched your search
@@ -4,7 +4,7 @@ import java.util.regex.Pattern;
|
||||
|
||||
class DbOrderByTrim {
|
||||
|
||||
private static final Pattern orderByTrim = Pattern.compile("(?i)\\b asc\\b|\\b desc\\b|\\b nulls first\\b|\\b nulls last\\b");
|
||||
private static final Pattern orderByTrim = Pattern.compile("(?i) asc\\b| desc\\b|\\b nulls first\\b|\\b nulls last\\b");
|
||||
|
||||
/**
|
||||
* Convert the dbOrderBy clause to be safe for adding to select or distinct on.
|
||||
|
||||
Reference in new issue
Block a user