summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/wrapper/quota.php
diff options
context:
space:
mode:
authorVincent Petry <pvince81@owncloud.com>2015-05-28 18:31:20 +0200
committerVincent Petry <pvince81@owncloud.com>2015-05-28 18:31:20 +0200
commite114d002421d5cf560ddc277bbd1604c4b70f03b (patch)
tree472200a1fd36e79095e495025a071296470ee180 /lib/private/files/storage/wrapper/quota.php
parent173b14730556d1b32d06e6b362c65b4a6dabb178 (diff)
downloadnextcloud-server-e114d002421d5cf560ddc277bbd1604c4b70f03b.tar.gz
nextcloud-server-e114d002421d5cf560ddc277bbd1604c4b70f03b.zip
Only use quota stream wrapper on "files"
Prevent using the quota stream wrapper on trashbin folders and other metadata folders
Diffstat (limited to 'lib/private/files/storage/wrapper/quota.php')
-rw-r--r--lib/private/files/storage/wrapper/quota.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php
index 92d749a814f..98664e27e2d 100644
--- a/lib/private/files/storage/wrapper/quota.php
+++ b/lib/private/files/storage/wrapper/quota.php
@@ -141,10 +141,12 @@ class Quota extends Wrapper {
$source = $this->storage->fopen($path, $mode);
$free = $this->free_space('');
if ($source && $free >= 0 && $mode !== 'r' && $mode !== 'rb') {
- return \OC\Files\Stream\Quota::wrap($source, $free);
- } else {
- return $source;
+ // only apply quota for files, not metadata, trash or others
+ if (strpos(ltrim($path, '/'), 'files/') === 0) {
+ return \OC\Files\Stream\Quota::wrap($source, $free);
+ }
}
+ return $source;
}
/**