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
diff options
context:
space:
mode:
-rw-r--r--apps/dav/appinfo/v1/publicwebdav.php8
-rw-r--r--lib/private/Files/Filesystem.php5
2 files changed, 7 insertions, 6 deletions
diff --git a/apps/dav/appinfo/v1/publicwebdav.php b/apps/dav/appinfo/v1/publicwebdav.php
index 670eadd5ea9..95fb71032d5 100644
--- a/apps/dav/appinfo/v1/publicwebdav.php
+++ b/apps/dav/appinfo/v1/publicwebdav.php
@@ -73,14 +73,12 @@ $server = $serverFactory->createServer($baseuri, $requestUri, $authBackend, func
$isReadable = $share->getPermissions() & \OCP\Constants::PERMISSION_READ;
$fileId = $share->getNodeId();
- /*
- if (!$isReadable) {
- return false;
- }*/
-
+ // 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();
diff --git a/lib/private/Files/Filesystem.php b/lib/private/Files/Filesystem.php
index ac0e66973d4..3f776a1a809 100644
--- a/lib/private/Files/Filesystem.php
+++ b/lib/private/Files/Filesystem.php
@@ -214,10 +214,13 @@ class Filesystem {
/**
* @param bool $shouldLog
+ * @return bool previous value
* @internal
*/
public static function logWarningWhenAddingStorageWrapper($shouldLog) {
- self::$logWarningWhenAddingStorageWrapper = (bool)$shouldLog;
+ $previousValue = self::$logWarningWhenAddingStorageWrapper;
+ self::$logWarningWhenAddingStorageWrapper = (bool) $shouldLog;
+ return $previousValue;
}
/**