summaryrefslogtreecommitdiffstats
path: root/lib/private
diff options
context:
space:
mode:
authorRoeland Jago Douma <rullzer@users.noreply.github.com>2020-12-16 10:47:32 +0100
committerGitHub <noreply@github.com>2020-12-16 10:47:32 +0100
commit1d4c8961ef1f65840f732297869996434a50f6d6 (patch)
treeb45891eac66bf33568f6ef6de6cf638b1eb2b7be /lib/private
parent7a774930388d3214be810c0f40e7d58f4109b455 (diff)
parentabad2efb449c5cbb29b5eb6a6e2227f0ef0074fc (diff)
downloadnextcloud-server-1d4c8961ef1f65840f732297869996434a50f6d6.tar.gz
nextcloud-server-1d4c8961ef1f65840f732297869996434a50f6d6.zip
Merge pull request #24659 from nextcloud/enh/noid/dav-honour-sharing.maxAutocompleteResults
dav principal search to honour sharing.maxAutocompleteResults setting
Diffstat (limited to 'lib/private')
-rw-r--r--lib/private/Contacts/ContactsMenu/Manager.php3
-rw-r--r--lib/private/Template/JSConfigHelper.php5
2 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/Contacts/ContactsMenu/Manager.php b/lib/private/Contacts/ContactsMenu/Manager.php
index 8f772b8e027..d08db5775e5 100644
--- a/lib/private/Contacts/ContactsMenu/Manager.php
+++ b/lib/private/Contacts/ContactsMenu/Manager.php
@@ -27,6 +27,7 @@
namespace OC\Contacts\ContactsMenu;
use OCP\App\IAppManager;
+use OCP\Constants;
use OCP\Contacts\ContactsMenu\IEntry;
use OCP\IConfig;
use OCP\IUser;
@@ -63,7 +64,7 @@ class Manager {
* @return array
*/
public function getEntries(IUser $user, $filter) {
- $maxAutocompleteResults = $this->config->getSystemValueInt('sharing.maxAutocompleteResults', 25);
+ $maxAutocompleteResults = max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT));
$minSearchStringLength = $this->config->getSystemValueInt('sharing.minSearchStringLength', 0);
$topEntries = [];
if (strlen($filter) >= $minSearchStringLength) {
diff --git a/lib/private/Template/JSConfigHelper.php b/lib/private/Template/JSConfigHelper.php
index ebe799bf4f8..83c8d7c0e42 100644
--- a/lib/private/Template/JSConfigHelper.php
+++ b/lib/private/Template/JSConfigHelper.php
@@ -33,6 +33,7 @@ namespace OC\Template;
use bantu\IniGetWrapper\IniGetWrapper;
use OC\CapabilitiesManager;
use OCP\App\IAppManager;
+use OCP\Constants;
use OCP\Defaults;
use OCP\IConfig;
use OCP\IGroupManager;
@@ -189,8 +190,8 @@ class JSConfigHelper {
'enable_avatars' => true, // here for legacy reasons - to not crash existing code that relies on this value
'lost_password_link' => $this->config->getSystemValue('lost_password_link', null),
'modRewriteWorking' => $this->config->getSystemValue('htaccess.IgnoreFrontController', false) === true || getenv('front_controller_active') === 'true',
- 'sharing.maxAutocompleteResults' => (int)$this->config->getSystemValue('sharing.maxAutocompleteResults', 0),
- 'sharing.minSearchStringLength' => (int)$this->config->getSystemValue('sharing.minSearchStringLength', 0),
+ 'sharing.maxAutocompleteResults' => max(0, $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT)),
+ 'sharing.minSearchStringLength' => $this->config->getSystemValueInt('sharing.minSearchStringLength', 0),
'blacklist_files_regex' => \OCP\Files\FileInfo::BLACKLIST_FILES_REGEX,
];