Only use scanner if remote is an ownCloud
This commit is contained in:
parent
e965dcaebf
commit
9ca1e9c7e9
1 changed files with 17 additions and 1 deletions
18
apps/files_sharing/lib/external/storage.php
vendored
18
apps/files_sharing/lib/external/storage.php
vendored
|
@ -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);
|
||||
}
|
||||
|
@ -239,6 +242,19 @@ class Storage extends DAV implements ISharedStorage {
|
|||
return (is_object($data) and !empty($data->version));
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
@ -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'];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue