Skip to content

Commit

Permalink
XWIKI-17568: clean sort parameter value
Browse files Browse the repository at this point in the history
- do not produce an error if the "sort" parameter
  is empty of missing
  • Loading branch information
ClemensRobbenhaar committed Mar 31, 2022
1 parent f5f3182 commit 673076e
Showing 1 changed file with 4 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ $response.setContentType("application/json")
## ORDER
##
#set ($order = "$!request.sort")
#if (!$regextool.compile('^(doc\.)?\w+$').matcher($order).matches())
{ "error" : "invalid sort parameter" }
#stop ("invalid sort parameter [$order] found")
#end
#set ($orderQueryPart = '')
#if ($order != '')
#if (!$regextool.compile('^(doc\.)?\w+$').matcher($order).matches())
{ "error" : "invalid sort parameter" }
#stop ("invalid sort parameter [$order] found")
#end
#set ($orderDirection = "$!{request.get('dir').toLowerCase()}")
#if ("$!orderDirection" != '' && "$!orderDirection" != 'asc')
#set($orderDirection = 'desc')
Expand Down

0 comments on commit 673076e

Please sign in to comment.