]> source.dussan.org Git - nextcloud-server.git/commitdiff
added another test, if unencrypted size and encrypted size are equal we can also...
authorBjoern Schiessle <schiessle@owncloud.com>
Tue, 15 Oct 2013 15:52:06 +0000 (17:52 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Tue, 15 Oct 2013 15:52:06 +0000 (17:52 +0200)
apps/files_encryption/lib/proxy.php

index 042becb32e33b4d2d1be6862a08535183d883ff1..1a950122119fcfd3f0b1b1eab0d4976631f128e7 100644 (file)
@@ -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