summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorMorris Jobke <hey@morrisjobke.de>2015-06-09 17:11:02 +0200
committerMorris Jobke <hey@morrisjobke.de>2015-06-09 17:11:02 +0200
commit952e774a0e96073a3931ce5a004091ca4625cfb0 (patch)
tree80b7523a36cb997cbc36ca8b08938e982bfcae6a /lib
parent000f3a5f26cae244c7c8fe900d3f6103fe4fa87d (diff)
parent960ca7b1a82808b7f3135e852960607ceadda1fe (diff)
downloadnextcloud-server-952e774a0e96073a3931ce5a004091ca4625cfb0.tar.gz
nextcloud-server-952e774a0e96073a3931ce5a004091ca4625cfb0.zip
Merge pull request #16630 from owncloud/stable8-quota-onlyforfiles
[stable8] Only use quota stream wrapper on "files"
Diffstat (limited to 'lib')
-rw-r--r--lib/private/files/storage/local.php2
-rw-r--r--lib/private/files/storage/wrapper/quota.php8
2 files changed, 6 insertions, 4 deletions
diff --git a/lib/private/files/storage/local.php b/lib/private/files/storage/local.php
index e8be7daba7e..7efa49a86c5 100644
--- a/lib/private/files/storage/local.php
+++ b/lib/private/files/storage/local.php
@@ -282,7 +282,7 @@ if (\OC_Util::runningOnWindows()) {
* @param string $path
* @return string
*/
- protected function getSourcePath($path) {
+ public function getSourcePath($path) {
$fullPath = $this->datadir . $path;
return $fullPath;
}
diff --git a/lib/private/files/storage/wrapper/quota.php b/lib/private/files/storage/wrapper/quota.php
index bf169e41f13..ed709eb2ce1 100644
--- a/lib/private/files/storage/wrapper/quota.php
+++ b/lib/private/files/storage/wrapper/quota.php
@@ -124,9 +124,11 @@ 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;
}
}