Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/server.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2016-11-02 12:22:36 +0300
committerVincent Petry <pvince81@owncloud.com>2016-11-07 19:49:00 +0300
commitef33460a4d6375da7bfedacccf9ead157c529a1d (patch)
treecac4b43f09ba411ff0f2e2191970dde0687100f2 /apps
parent3067040a30acea791fef5803969c544904247918 (diff)
Hack to prevent warning for read-only wrapper in public links
Storage wrappers should normally always be registered inside a presetup hook. However in the public link scenario this is not possible and there is currently no good alternative with the current architecture. Instead of logging a warning every time, this fix prevents the warning to be shown but also adds a FIXME in the code for the future. This is ok because this app is already using private/internal APIs at the moment and should be reworked properly in the future.
Diffstat (limited to 'apps')
-rw-r--r--apps/dav/appinfo/v1/publicwebdav.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php
index 07004f43bd7..4042a84eef3 100644
--- a/apps/dav/appinfo/v1/publicwebdav.php
+++ b/apps/dav/appinfo/v1/publicwebdav.php
@@ -68,9 +68,12 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, func
$owner = $share->getShareOwner();
$fileId = $share->getNodeId();
+ // FIXME: should not add storage wrappers outside of preSetup, need to find a better way
+ $previousLog = \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper(false);
\OC\Files\Filesystem::addStorageWrapper('sharePermissions', function ($mountPoint, $storage) use ($share) {
return new \OC\Files\Storage\Wrapper\PermissionsMask(array('storage' => $storage, 'mask' => $share->getPermissions() | \OCP\Constants::PERMISSION_SHARE));
});
+ \OC\Files\Filesystem::logWarningWhenAddingStorageWrapper($previousLog);
OC_Util::setupFS($owner);
$ownerView = \OC\Files\Filesystem::getView();