summaryrefslogtreecommitdiffstats
path: root/core/Controller/AutoCompleteController.php
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-28 13:30:51 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2017-11-28 13:30:51 +0100
commit96bc03a03a7d7b1d5868eed5c1cc86b1b9b8ca2c (patch)
tree42fa9dbca516aa9638d3e28fa0abc8c47f6eaf5b /core/Controller/AutoCompleteController.php
parenta0ce2c1204861e64219f6375f6ff8d13e63cfe32 (diff)
downloadnextcloud-server-96bc03a03a7d7b1d5868eed5c1cc86b1b9b8ca2c.tar.gz
nextcloud-server-96bc03a03a7d7b1d5868eed5c1cc86b1b9b8ca2c.zip
don't create sorter instances when none was requested
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'core/Controller/AutoCompleteController.php')
-rw-r--r--core/Controller/AutoCompleteController.php12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/Controller/AutoCompleteController.php b/core/Controller/AutoCompleteController.php
index 2e01f85c639..1619f9b9edd 100644
--- a/core/Controller/AutoCompleteController.php
+++ b/core/Controller/AutoCompleteController.php
@@ -73,11 +73,13 @@ class AutoCompleteController extends Controller {
unset($results['exact']);
$results = array_merge_recursive($exactMatches, $results);
- $sorters = array_reverse(explode('|', $sorter));
- $this->autoCompleteManager->runSorters($sorters, $results, [
- 'itemType' => $itemType,
- 'itemId' => $itemId,
- ]);
+ if($sorter !== null) {
+ $sorters = array_reverse(explode('|', $sorter));
+ $this->autoCompleteManager->runSorters($sorters, $results, [
+ 'itemType' => $itemType,
+ 'itemId' => $itemId,
+ ]);
+ }
// transform to expected format
$results = $this->prepareResultArray($results);