From 649bed5154c1f70d05dc04f7834fd8eed8460c2a Mon Sep 17 00:00:00 2001 From: Robin Appelman Date: Fri, 3 Mar 2023 17:10:56 +0100 Subject: fix unencrypted_size for files when scanning Signed-off-by: Robin Appelman --- lib/private/Files/Storage/Wrapper/Encryption.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'lib/private/Files/Storage') 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 -- cgit v1.2.3