Regex changed in order to actually allow ordering by columns annotated as table.column
This commit is contained in:
parent
69747b3741
commit
f14bdd6b3f
|
@ -16,7 +16,7 @@ func (filter *Filter) FormatSQL() (string, error) {
|
||||||
|
|
||||||
if filter.OrderBy != nil {
|
if filter.OrderBy != nil {
|
||||||
order_by := filter.OrderBy
|
order_by := filter.OrderBy
|
||||||
match, err := regexp.MatchString("^(\\w+(,\\s*))*\\w+$", strings.TrimSpace(*filter.OrderBy))
|
match, err := regexp.MatchString("^(\\w+(?:\\.\\w+)?(,\\s)?)+$", strings.TrimSpace(*filter.OrderBy))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return "", err
|
return "", err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue