From eaa4f92275a5dea91743eab57423c2b698386e69 Mon Sep 17 00:00:00 2001
From: Florin Peter <github@florin-peter.de>
Date: Thu, 30 May 2013 22:07:36 +0200
Subject: [PATCH] added our own file extension .part will not work here if we
 use file_get_contents so we used our own extension '.etmp'

---
 apps/files_encryption/lib/keymanager.php | 4 ++--
 apps/files_encryption/lib/proxy.php      | 6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/apps/files_encryption/lib/keymanager.php b/apps/files_encryption/lib/keymanager.php
index 9bb854325d..e911c1785d 100755
--- a/apps/files_encryption/lib/keymanager.php
+++ b/apps/files_encryption/lib/keymanager.php
@@ -169,7 +169,7 @@ class Keymanager {
 	 */
 	public static function fixPartialFilePath($path) {
 
-		if (preg_match('/\.part$/', $path)) {
+		if (preg_match('/\.part$/', $path) || preg_match('/\.etmp$/', $path)) {
 
 			$newLength = strlen($path) - 5;
 			$fPath = substr($path, 0, $newLength);
@@ -191,7 +191,7 @@ class Keymanager {
 	 */
 	public static function isPartialFilePath($path) {
 
-		if (preg_match('/\.part$/', $path)) {
+		if (preg_match('/\.part$/', $path) || preg_match('/\.etmp$/', $path)) {
 
 			return true;
 
diff --git a/apps/files_encryption/lib/proxy.php b/apps/files_encryption/lib/proxy.php
index 2e18f7f920..0df34a38bd 100644
--- a/apps/files_encryption/lib/proxy.php
+++ b/apps/files_encryption/lib/proxy.php
@@ -116,7 +116,7 @@ class Proxy extends \OC_FileProxy {
 					return true;
 				}
 
-				$handle = fopen('crypt://' . $relativePath . '.part', 'w');
+				$handle = fopen('crypt://' . $relativePath . '.etmp', 'w');
 				if (is_resource($handle)) {
 
 					// write data to stream
@@ -130,10 +130,10 @@ class Proxy extends \OC_FileProxy {
 					\OC_FileProxy::$enabled = false;
 
 					// get encrypted content
-					$data = $view->file_get_contents($path . '.part');
+					$data = $view->file_get_contents($path . '.etmp');
 
 					// remove our temp file
-					$view->unlink($path . '.part');
+					$view->unlink($path . '.etmp');
 
 					// re-enable proxy - our work is done
 					\OC_FileProxy::$enabled = $proxyStatus;
-- 
GitLab