diff options
author | Roeland Jago Douma <rullzer@users.noreply.github.com> | 2017-12-11 15:27:44 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-12-11 15:27:44 +0100 |
commit | c1fcd6fc98c43c7a0298d68e1c2533132b12176d (patch) | |
tree | bb38a5509b4ac3f505ae7c6f1c98440e12a4bc5b /core/Controller | |
parent | 7c39711798354cd99dd9d8740e8c97f0d0f0fecc (diff) | |
parent | 96bc03a03a7d7b1d5868eed5c1cc86b1b9b8ca2c (diff) | |
download | nextcloud-server-c1fcd6fc98c43c7a0298d68e1c2533132b12176d.tar.gz nextcloud-server-c1fcd6fc98c43c7a0298d68e1c2533132b12176d.zip |
Merge pull request #7324 from nextcloud/no-sorters-no-instances
don't create sorter instances when none was requested
Diffstat (limited to 'core/Controller')
-rw-r--r-- | core/Controller/AutoCompleteController.php | 12 |
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); |