From: Bjoern Schiessle Date: Wed, 30 Apr 2014 10:48:16 +0000 (+0200) Subject: only update the values which really changed X-Git-Tag: v7.0.0alpha2~325^2~1 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=57b671ebecfc92388e1a90c9e29eca8427247d0e;p=nextcloud-server.git only update the values which really changed --- diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php index 03ddc795eae..7be82c313e4 100644 --- a/apps/files_encryption/lib/proxy.php +++ b/apps/files_encryption/lib/proxy.php @@ -340,26 +340,24 @@ class Proxy extends \OC_FileProxy { $fileInfo['unencrypted_size'] = $fixSize; // put file info if not .part file if (!Helper::isPartialFilePath($relativePath)) { - $view->putFileInfo($path, $fileInfo); + $view->putFileInfo($path, array('unencrypted_size' => $fixSize)); } } $size = $fileInfo['unencrypted_size']; } else { - // self healing if file was removed from file cache - if (!$fileInfo) { - $fileInfo = array(); - } + + $fileInfoUpdates = array(); $fixSize = $util->getFileSize($path); if ($fixSize > 0) { $size = $fixSize; - $fileInfo['encrypted'] = true; - $fileInfo['unencrypted_size'] = $size; + $fileInfoUpdates['encrypted'] = true; + $fileInfoUpdates['unencrypted_size'] = $size; // put file info if not .part file if (!Helper::isPartialFilePath($relativePath)) { - $view->putFileInfo($path, $fileInfo); + $view->putFileInfo($path, $fileInfoUpdates); } }