From 59d4d00106382a9c1c08695020dc6e6e21fa1aa5 Mon Sep 17 00:00:00 2001 From: Marcelo Andrade R Date: Tue, 12 Dec 2017 08:52:37 -0500 Subject: [PATCH] fix when a request pass a sortField only a - --- src/API/SearchHelper.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/API/SearchHelper.php b/src/API/SearchHelper.php index dcc3656..4fe8a00 100755 --- a/src/API/SearchHelper.php +++ b/src/API/SearchHelper.php @@ -233,7 +233,9 @@ public function getSort($format = 'native') foreach ($sortFields as $order) { if (substr($order, 0, 1) == '-') { $subOrder = substr($order, 1); - $parsedSorts[] = $subOrder . " DESC"; + if (!empty($subOrder)) { + $parsedSorts[] = $subOrder . " DESC"; + } } else { $parsedSorts[] = $order; }