From 8e4ae23c487b29bd8ea1a6d7d81e6996957e86fb Mon Sep 17 00:00:00 2001 From: Arthur Schiwon Date: Wed, 17 Oct 2018 13:09:11 +0200 Subject: Do not try to contact lookup server without internet connection or URL Signed-off-by: Arthur Schiwon --- lib/private/Collaboration/Collaborators/LookupPlugin.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'lib/private') 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 = []; -- cgit v1.2.3