diff options
author | Vincent Petry <pvince81@owncloud.com> | 2014-01-19 18:49:51 +0100 |
---|---|---|
committer | Vincent Petry <pvince81@owncloud.com> | 2014-01-19 18:51:36 +0100 |
commit | 1af7dab5358d7fd495e4382037c6e2528e2b76d5 (patch) | |
tree | d2d27a980780f1f4a68f3b2afc93e8c84486e986 /lib/private | |
parent | 903b330cccaad0233274199c9ee8f047478bb72e (diff) | |
download | nextcloud-server-1af7dab5358d7fd495e4382037c6e2528e2b76d5.tar.gz nextcloud-server-1af7dab5358d7fd495e4382037c6e2528e2b76d5.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/private')
-rw-r--r-- | lib/private/files/storage/wrapper/quota.php | 2 |
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; |