aboutsummaryrefslogtreecommitdiffstats
path: root/lib/private/Files/Storage
diff options
context:
space:
mode:
authorRobin Appelman <robin@icewind.nl>2023-03-03 17:10:56 +0100
committerRobin Appelman <robin@icewind.nl>2023-04-04 16:48:11 +0200
commit649bed5154c1f70d05dc04f7834fd8eed8460c2a (patch)
tree9328792413a0d280d61523ba5cc53173d90e6ace /lib/private/Files/Storage
parent63fb33538cada5402d04f8b933bb098e6bb22d13 (diff)
downloadnextcloud-server-649bed5154c1f70d05dc04f7834fd8eed8460c2a.tar.gz
nextcloud-server-649bed5154c1f70d05dc04f7834fd8eed8460c2a.zip
fix unencrypted_size for files when scanning
Signed-off-by: Robin Appelman <robin@icewind.nl>
Diffstat (limited to 'lib/private/Files/Storage')
-rw-r--r--lib/private/Files/Storage/Wrapper/Encryption.php5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php
index 4d860e623e0..e825d6de118 100644
--- a/lib/private/Files/Storage/Wrapper/Encryption.php
+++ b/lib/private/Files/Storage/Wrapper/Encryption.php
@@ -180,10 +180,12 @@ class Encryption extends Wrapper {
if (isset($this->unencryptedSize[$fullPath])) {
$data['encrypted'] = true;
$data['size'] = $this->unencryptedSize[$fullPath];
+ $data['unencrypted_size'] = $data['size'];
} else {
if (isset($info['fileid']) && $info['encrypted']) {
$data['size'] = $this->verifyUnencryptedSize($path, $info->getUnencryptedSize());
$data['encrypted'] = true;
+ $data['unencrypted_size'] = $data['size'];
}
}
@@ -494,7 +496,8 @@ class Encryption extends Wrapper {
$result = $unencryptedSize;
if ($unencryptedSize < 0 ||
- ($size > 0 && $unencryptedSize === $size)
+ ($size > 0 && $unencryptedSize === $size) ||
+ $unencryptedSize > $size
) {
// check if we already calculate the unencrypted size for the
// given path to avoid recursions