]> source.dussan.org Git - nextcloud-server.git/commitdiff
fix file info put on stream
authorFlorin Peter <github@florin-peter.de>
Mon, 6 May 2013 19:15:25 +0000 (21:15 +0200)
committerFlorin Peter <github@florin-peter.de>
Mon, 6 May 2013 19:15:25 +0000 (21:15 +0200)
apps/files_encryption/lib/stream.php

index a51f2c56d953f75fa5dc5746dca64d29502192ce..eb1cb45871c847cc434b869645c9dda6b84eb40a 100644 (file)
@@ -512,7 +512,19 @@ class Stream {
             // Re-enable proxy - our work is done
             \OC_FileProxy::$enabled = $proxyStatus;
 
-                       \OC\Files\Filesystem::putFileInfo( $this->relPath, array( 'encrypted' => 1, 'size' => $this->size, 'unencrypted_size' => $this->unencryptedSize ), '' );
+            // get file info
+            $fileInfo = \OC\Files\Filesystem::getFileInfo($this->rawPath);
+            if(!is_array($fileInfo)) {
+                $fileInfo = array();
+            }
+
+            // set encryption data
+            $fileInfo['encrypted'] = 1;
+            $fileInfo['size'] = $this->size;
+            $fileInfo['unencrypted_size'] = $this->unencryptedSize;
+
+            // set fileinfo
+                       \OC\Files\Filesystem::putFileInfo( $this->rawPath, $fileInfo);
                }
 
                return fclose( $this->handle );