summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorArthur Schiwon <blizzz@arthur-schiwon.de>2018-10-17 13:09:11 +0200
committerArthur Schiwon <blizzz@arthur-schiwon.de>2018-10-18 17:49:28 +0200
commit8e4ae23c487b29bd8ea1a6d7d81e6996957e86fb (patch)
tree988f2f5d48e5e0cd958867849f36674245d8ee05 /lib
parent7c8b3c1056d2549734ec4bb9ed547468ca2c2331 (diff)
downloadnextcloud-server-8e4ae23c487b29bd8ea1a6d7d81e6996957e86fb.tar.gz
nextcloud-server-8e4ae23c487b29bd8ea1a6d7d81e6996957e86fb.zip
Do not try to contact lookup server without internet connection or URL
Signed-off-by: Arthur Schiwon <blizzz@arthur-schiwon.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/private/Collaboration/Collaborators/LookupPlugin.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/private/Collaboration/Collaborators/LookupPlugin.php b/lib/private/Collaboration/Collaborators/LookupPlugin.php
index ae5f7fd0cbc..fb7c872c30c 100644
--- a/lib/private/Collaboration/Collaborators/LookupPlugin.php
+++ b/lib/private/Collaboration/Collaborators/LookupPlugin.php
@@ -63,12 +63,17 @@ class LookupPlugin implements ISearchPlugin {
public function search($search, $limit, $offset, ISearchResult $searchResult) {
$isGlobalScaleEnabled = $this->config->getSystemValue('gs.enabled', false);
$isLookupServerEnabled = $this->config->getAppValue('files_sharing', 'lookupServerEnabled', 'no') === 'yes';
+ $hasInternetConnection = (bool)$this->config->getSystemValue('has_internet_connection', true);
+
// if case of Global Scale we always search the lookup server
- if (!$isLookupServerEnabled && !$isGlobalScaleEnabled) {
+ if ((!$isLookupServerEnabled && !$isGlobalScaleEnabled) || !$hasInternetConnection) {
return false;
}
$lookupServerUrl = $this->config->getSystemValue('lookup_server', 'https://lookup.nextcloud.com');
+ if(empty($lookupServerUrl)) {
+ return false;
+ }
$lookupServerUrl = rtrim($lookupServerUrl, '/');
$result = [];