]> source.dussan.org Git - nextcloud-server.git/commitdiff
only update the values which really changed
authorBjoern Schiessle <schiessle@owncloud.com>
Wed, 30 Apr 2014 10:48:16 +0000 (12:48 +0200)
committerBjoern Schiessle <schiessle@owncloud.com>
Wed, 30 Apr 2014 10:48:16 +0000 (12:48 +0200)
apps/files_encryption/lib/proxy.php

index 03ddc795eaec0c9f7828c9447ac862553c7948e2..7be82c313e494805129809658341399777f74d13 100644 (file)
@@ -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);
                                }
                        }