summaryrefslogtreecommitdiffstats
path: root/apps/files_sharing/lib/external/storage.php
diff options
context:
space:
mode:
Diffstat (limited to 'apps/files_sharing/lib/external/storage.php')
-rw-r--r--apps/files_sharing/lib/external/storage.php14
1 files changed, 10 insertions, 4 deletions
diff --git a/apps/files_sharing/lib/external/storage.php b/apps/files_sharing/lib/external/storage.php
index ba7fba654a9..7f54a955da2 100644
--- a/apps/files_sharing/lib/external/storage.php
+++ b/apps/files_sharing/lib/external/storage.php
@@ -218,20 +218,26 @@ class Storage extends DAV implements ISharedStorage {
}
/**
- * check if the configured remote is a valid ownCloud instance
+ * check if the configured remote is a valid federated share provider
*
* @return bool
*/
protected function testRemote() {
try {
- $result = file_get_contents($this->remote . '/status.php');
- $data = json_decode($result);
- return is_object($data) and !empty($data->version);
+ return $this->testRemoteUrl($this->remote . '/ocs-provider/index.php')
+ || $this->testRemoteUrl($this->remote . '/ocs-provider')
+ || $this->testRemoteUrl($this->remote . '/status.php');
} catch (\Exception $e) {
return false;
}
}
+ private function testRemoteUrl($url) {
+ $result = file_get_contents($url);
+ $data = json_decode($result);
+ return (is_object($data) and !empty($data->version));
+ }
+
/**
* @return mixed
* @throws ForbiddenException