From 673076e2e8b88a36cdeaf7007843aa9ca1a068a0 Mon Sep 17 00:00:00 2001 From: Clemens Klein-Robbenhaar Date: Thu, 31 Mar 2022 14:33:38 +0200 Subject: [PATCH] XWIKI-17568: clean sort parameter value - do not produce an error if the "sort" parameter is empty of missing --- .../src/main/resources/templates/getdocuments.vm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/getdocuments.vm b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/getdocuments.vm index 069562a155dd..dabb02d8fc13 100644 --- a/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/getdocuments.vm +++ b/xwiki-platform-core/xwiki-platform-web/xwiki-platform-web-templates/src/main/resources/templates/getdocuments.vm @@ -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')