summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2014-01-19 18:49:51 +0100
committerVincent Petry <pvince81@owncloud.com>2014-01-20 14:32:57 +0100
commit09cc0c5cc9577980e79ba6a1ba8363682395f378 (patch)
tree68128cffb9944ba5b0fa5a351be2134f395a0516 /lib
parentc4c5e34110ee811a6e73af6addfae30aa59adb3b (diff)
downloadnextcloud-server-09cc0c5cc9577980e79ba6a1ba8363682395f378.tar.gz
nextcloud-server-09cc0c5cc9577980e79ba6a1ba8363682395f378.zip
Fixed quota wrapper to not wrap failed fopen streams
When calling fopen() on some storage types, these return false instead of throwing an exception. This fix makes sure that in case the stream wasn't opened (for example when a file doesn't exist any more) the stream isn't wrapped. Also added 'rb' as another case that doesn't need to be wrapped. Fixes #6832
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/wrapper/quota.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php
index 43016e0892f..a430e3e4617 100644
--- a/lib/private/files/storage/wrapper/quota.php
+++ b/lib/private/files/storage/wrapper/quota.php
@@ -95,7 +95,7 @@ class Quota extends Wrapper {
public function fopen($path, $mode) {
$source = $this->storage->fopen($path, $mode);
$free = $this->free_space('');
- if ($free >= 0 && $mode !== 'r') {
+ if ($source && $free >= 0 && $mode !== 'r' && $mode !== 'rb') {
return \OC\Files\Stream\Quota::wrap($source, $free);
} else {
return $source;