From: Bjoern Schiessle Date: Tue, 15 Oct 2013 15:52:06 +0000 (+0200) Subject: added another test, if unencrypted size and encrypted size are equal we can also... X-Git-Tag: v6.0.0beta2~107^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=0811d2e30443de46f8e1202ec09c3c93fed87f2c;p=nextcloud-server.git added another test, if unencrypted size and encrypted size are equal we can also assume that something is wrong --- diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 042becb32e3..1a950122119 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -348,7 +348,9 @@ class Proxy extends \OC_FileProxy { // if file is encrypted return real file size if (is_array($fileInfo) && $fileInfo['encrypted'] === true) { // try to fix unencrypted file size if it doesn't look plausible - if ((int)$fileInfo['size'] > 0 && (int)$fileInfo['unencrypted_size'] === 0) { + if ((int)$fileInfo['size'] > 0 && + ((int)$fileInfo['unencrypted_size'] === 0 || + (int)$fileInfo['size'] === (int)$fileInfo['unencrypted_size'])) { $fixSize = $util->getFileSize($path); $fileInfo['unencrypted_size'] = $fixSize; // put file info if not .part file