summaryrefslogtreecommitdiffstats
path: root/apps/dav/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2020-12-12 00:25:10 +0100
committerArthur Schiwon <blizzz@arthur-schiwon.de>2020-12-15 11:53:39 +0100
commitd8ad4ef6b5fc038e8187dc285925cd1a0d7fb5bf (patch)
tree2ecbc4bf0bcd0737f7cf57ecb6bbee22982a1928 /apps/dav/lib
parent2b017b704a4a49801bc09774a1a17cfedca9cc7e (diff)
downloadnextcloud-server-d8ad4ef6b5fc038e8187dc285925cd1a0d7fb5bf.tar.gz
nextcloud-server-d8ad4ef6b5fc038e8187dc285925cd1a0d7fb5bf.zip
use a consistent default value for sharing.maxAutocompleteResults
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'apps/dav/lib')
-rw-r--r--apps/dav/lib/Connector/Sabre/Principal.php6
-rw-r--r--apps/dav/lib/DAV/GroupPrincipalBackend.php6
2 files changed, 10 insertions, 2 deletions
diff --git a/apps/dav/lib/Connector/Sabre/Principal.php b/apps/dav/lib/Connector/Sabre/Principal.php
index 12e1d18faa2..bf03569bd5b 100644
--- a/apps/dav/lib/Connector/Sabre/Principal.php
+++ b/apps/dav/lib/Connector/Sabre/Principal.php
@@ -39,6 +39,7 @@ use OCA\DAV\CalDAV\Proxy\ProxyMapper;
use OCA\DAV\Traits\PrincipalProxyTrait;
use OCP\App\IAppManager;
use OCP\AppFramework\QueryException;
+use OCP\Constants;
use OCP\IConfig;
use OCP\IGroupManager;
use OCP\IUser;
@@ -270,7 +271,10 @@ class Principal implements BackendInterface {
}
}
- $searchLimit = $this->config->getSystemValue('sharing.maxAutocompleteResults', null);
+ $searchLimit = $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT);
+ if ($searchLimit <= 0) {
+ $searchLimit = null;
+ }
foreach ($searchProperties as $prop => $value) {
switch ($prop) {
case '{http://sabredav.org/ns}email-address':
diff --git a/apps/dav/lib/DAV/GroupPrincipalBackend.php b/apps/dav/lib/DAV/GroupPrincipalBackend.php
index 747976b6ad3..8b9c5aa9488 100644
--- a/apps/dav/lib/DAV/GroupPrincipalBackend.php
+++ b/apps/dav/lib/DAV/GroupPrincipalBackend.php
@@ -27,6 +27,7 @@
namespace OCA\DAV\DAV;
+use OCP\Constants;
use OCP\IConfig;
use OCP\IGroup;
use OCP\IGroupManager;
@@ -212,7 +213,10 @@ class GroupPrincipalBackend implements BackendInterface {
$restrictGroups = $this->groupManager->getUserGroupIds($user);
}
- $searchLimit = $this->config->getSystemValue('sharing.maxAutocompleteResults', null);
+ $searchLimit = $this->config->getSystemValueInt('sharing.maxAutocompleteResults', Constants::SHARING_MAX_AUTOCOMPLETE_RESULTS_DEFAULT);
+ if ($searchLimit <= 0) {
+ $searchLimit = null;
+ }
foreach ($searchProperties as $prop => $value) {
switch ($prop) {
case '{DAV:}displayname':