Merge pull request #30444 from nextcloud/backport/30353/stable22

This commit is contained in:
John Molakvoæ 2021-12-30 08:10:57 +01:00 committed by GitHub
commit 6c051b242b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -44,6 +44,7 @@ use OCP\Files\NotFoundException;
use OCP\Files\Storage\IDisableEncryptionStorage;
use OCP\Files\StorageInvalidException;
use OCP\Files\StorageNotAvailableException;
use OCP\Http\Client\LocalServerException;
class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage {
/** @var ICloudId */
@ -314,9 +315,16 @@ class Storage extends DAV implements ISharedStorage, IDisableEncryptionStorage {
$token = $this->getToken();
$password = $this->getPassword();
// If remote is not an ownCloud do not try to get any share info
if (!$this->remoteIsOwnCloud()) {
return ['status' => 'unsupported'];
try {
// If remote is not an ownCloud do not try to get any share info
if (!$this->remoteIsOwnCloud()) {
return ['status' => 'unsupported'];
}
} catch (LocalServerException $e) {
// throw this to be on the safe side: the share will still be visible
// in the UI in case the failure is intermittent, and the user will
// be able to decide whether to remove it if it's really gone
throw new StorageNotAvailableException();
}
$url = rtrim($remote, '/') . '/index.php/apps/files_sharing/shareinfo?t=' . $token;