Merge pull request #7407 from nextcloud/12_7348
[stable12] Check if owner of share exists
This commit is contained in:
commit
c9318ddd1b
|
@ -29,6 +29,7 @@
|
|||
|
||||
namespace OCA\DAV\Connector\Sabre;
|
||||
|
||||
use OC\Files\Storage\FailedStorage;
|
||||
use OCA\DAV\Connector\Sabre\Exception\Forbidden;
|
||||
use OCA\DAV\Connector\Sabre\Exception\InvalidPath;
|
||||
use OCA\DAV\Connector\Sabre\Exception\FileLocked;
|
||||
|
@ -158,6 +159,10 @@ class ObjectTree extends \Sabre\DAV\Tree {
|
|||
// read from cache
|
||||
try {
|
||||
$info = $this->fileView->getFileInfo($path);
|
||||
|
||||
if ($info instanceof \OCP\Files\FileInfo && $info->getStorage()->instanceOfStorage(FailedStorage::class)) {
|
||||
throw new StorageNotAvailableException();
|
||||
}
|
||||
} catch (StorageNotAvailableException $e) {
|
||||
throw new \Sabre\DAV\Exception\ServiceUnavailable('Storage is temporarily not available');
|
||||
} catch (StorageInvalidException $e) {
|
||||
|
|
|
@ -174,6 +174,8 @@ class ObjectTreeTest extends \Test\TestCase {
|
|||
$fileInfo->expects($this->once())
|
||||
->method('getName')
|
||||
->will($this->returnValue($outputFileName));
|
||||
$fileInfo->method('getStorage')
|
||||
->willReturn($this->createMock(\OC\Files\Storage\Common::class));
|
||||
|
||||
$view->expects($this->once())
|
||||
->method('getFileInfo')
|
||||
|
|
Loading…
Reference in New Issue