Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLukas Reschke <lukas@owncloud.com>2016-03-01 08:49:35 +0300
committerLukas Reschke <lukas@owncloud.com>2016-03-01 09:01:52 +0300
commit9ca1e9c7e941ee04a33bdf092739df367fe68356 (patch)
tree834cd58ae420b4cd0e50c0dfb0c0276524a46744
parente965dcaebf77fc7bdcf67c06c80fe9e0c4ee20b1 (diff)
Only use scanner if remote is an ownCloud
-rw-r--r--apps/files_sharing/lib/external/storage.php18
1 files changed, 17 insertions, 1 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index 514df41eac9..ed391f331ad 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -137,6 +137,9 @@ class Storage extends DAV implements ISharedStorage {
if (!$storage) {
$storage = $this;
}
+ if(!$this->remoteIsOwnCloud()) {
+ return parent::getScanner($path, $storage);
+ }
if (!isset($this->scanner)) {
$this->scanner = new Scanner($storage);
}
@@ -240,6 +243,19 @@ class Storage extends DAV implements ISharedStorage {
}
/**
+ * Whether the remote is an ownCloud, used since some sharing features are not
+ * standardized. Let's use this to detect whether to use it.
+ *
+ * @return bool
+ */
+ private function remoteIsOwnCloud() {
+ if(defined('PHPUNIT_RUN') || !$this->testRemoteUrl($this->getRemote() . '/status.php')) {
+ return false;
+ }
+ return true;
+ }
+
+ /**
* @return mixed
* @throws ForbiddenException
* @throws NotFoundException
@@ -251,7 +267,7 @@ class Storage extends DAV implements ISharedStorage {
$password = $this->getPassword();
// If remote is not an ownCloud do not try to get any share info
- if(!$this->testRemoteUrl($remote . '/status.php')) {
+ if(!$this->remoteIsOwnCloud()) {
return ['status' => 'unsupported'];
}