From fe6d12ddec46e5d68486d5db22a8508a2ab2b2ea Mon Sep 17 00:00:00 2001
From: Florin Peter <github@florin-peter.de>
Date: Mon, 6 May 2013 21:15:25 +0200
Subject: [PATCH] fix file info put on stream

---
 apps/files_encryption/lib/stream.php | 14 +++++++++++++-
 1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/apps/files_encryption/lib/stream.php b/apps/files_encryption/lib/stream.php
index a51f2c56d9..eb1cb45871 100644
--- a/apps/files_encryption/lib/stream.php
+++ b/apps/files_encryption/lib/stream.php
@@ -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 );
-- 
GitLab