diff options
author | Vincent Petry <pvince81@owncloud.com> | 2015-06-30 13:45:41 +0200 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2015-06-30 13:45:41 +0200 |
commit | afd83caf69b2095cf401dd347b48fce891a1af86 (patch) | |
tree | b2537c156477b6ad4f5bb9679c398e1811e051d7 | |
parent | a1bfc26b883e458389712af8624a0d76e83a536a (diff) | |
download | nextcloud-server-afd83caf69b2095cf401dd347b48fce891a1af86.tar.gz nextcloud-server-afd83caf69b2095cf401dd347b48fce891a1af86.zip |
Do not set callback wrapper when locking is disabled
-rw-r--r-- | lib/private/files/view.php | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/files/view.php b/lib/private/files/view.php index 0c3bc54a41d..5fa6a0a051b 100644 --- a/lib/private/files/view.php +++ b/lib/private/files/view.php @@ -79,6 +79,8 @@ class View { */ private $lockingProvider; + private $lockingEnabled; + /** * @param string $root * @throws \Exception If $root contains an invalid path @@ -94,6 +96,7 @@ class View { $this->fakeRoot = $root; $this->updater = new Updater($this); $this->lockingProvider = \OC::$server->getLockingProvider(); + $this->lockingEnabled = !($this->lockingProvider instanceof \OC\Lock\NoopLockingProvider); } public function getAbsolutePath($path = '/') { @@ -1021,7 +1024,7 @@ class View { } $unlockLater = false; - if ($operation === 'fopen' and is_resource($result)) { + if ($this->lockingEnabled && $operation === 'fopen' && is_resource($result)) { $unlockLater = true; $result = CallbackWrapper::wrap($result, null, null, function () use ($hooks, $path) { if (in_array('write', $hooks)) { |