summaryrefslogtreecommitdiffstats
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-08-11 11:13:50 +0200
committerVincent Petry <pvince81@owncloud.com>2016-08-15 11:09:39 +0200
commit837bf1c587b9ee55512390028cac9657cc0d81ea (patch)
tree1b2046c240262942234cc2c4bfc3e1df2b4e237d /apps
parentdc7d55c857707360d70fa013701424d3696af8ce (diff)
downloadnextcloud-server-837bf1c587b9ee55512390028cac9657cc0d81ea.tar.gz
nextcloud-server-837bf1c587b9ee55512390028cac9657cc0d81ea.zip
Use FailedStorage when share is invalid
Diffstat (limited to 'apps')
-rw-r--r--apps/files_sharing/lib/sharedstorage.php7
1 files changed, 4 insertions, 3 deletions
diff --git a/apps/files_sharing/lib/sharedstorage.php b/apps/files_sharing/lib/sharedstorage.php
index 45d36ab4bf3..a25b328fcf0 100644
--- a/apps/files_sharing/lib/sharedstorage.php
+++ b/apps/files_sharing/lib/sharedstorage.php
@@ -37,6 +37,7 @@ use OCP\Constants;
use OCP\Files\Cache\ICacheEntry;
use OCP\Files\Storage\IStorage;
use OCP\Lock\ILockingProvider;
+use OC\Files\Storage\FailedStorage;
/**
* Convert target path to source path and pass the function call to the correct storage provider
@@ -99,12 +100,13 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
list($this->sourceStorage, $sourceInternalPath) = $this->ownerView->resolvePath($sourcePath);
$this->sourceRootInfo = $this->sourceStorage->getCache()->get($sourceInternalPath);
// adjust jail
- $this->storage = $this->sourceStorage;
$this->rootPath = $sourceInternalPath;
} catch (\Exception $e) {
+ $this->sourceStorage = new FailedStorage(['exception' => $e]);
$this->logger->logException($e);
}
+ $this->storage = $this->sourceStorage;
}
/**
@@ -311,7 +313,7 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
public function getCache($path = '', $storage = null) {
$this->init();
- if (is_null($this->sourceStorage)) {
+ if (is_null($this->sourceStorage) || $this->sourceStorage instanceof FailedStorage) {
return new FailedCache(false);
}
if (!$storage) {
@@ -439,5 +441,4 @@ class Shared extends \OC\Files\Storage\Wrapper\Jail implements ISharedStorage {
return $this->sourceStorage;
}
-
}