added another test, if unencrypted size and encrypted size are equal we can also assume that something is wrong

This commit is contained in:
Bjoern Schiessle 2013-10-15 17:52:06 +02:00
parent 58196304b8
commit 0811d2e304
1 changed files with 3 additions and 1 deletions

View File

@ -348,7 +348,9 @@ class Proxy extends \OC_FileProxy {
// if file is encrypted return real file size // if file is encrypted return real file size
if (is_array($fileInfo) && $fileInfo['encrypted'] === true) { if (is_array($fileInfo) && $fileInfo['encrypted'] === true) {
// try to fix unencrypted file size if it doesn't look plausible // 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); $fixSize = $util->getFileSize($path);
$fileInfo['unencrypted_size'] = $fixSize; $fileInfo['unencrypted_size'] = $fixSize;
// put file info if not .part file // put file info if not .part file