]> source.dussan.org Git - nextcloud-server.git/commitdiff
added our own file extension .part will not work here if we use file_get_contents...
authorFlorin Peter <github@florin-peter.de>
Thu, 30 May 2013 20:07:36 +0000 (22:07 +0200)
committerFlorin Peter <github@florin-peter.de>
Fri, 31 May 2013 10:28:45 +0000 (12:28 +0200)
apps/files_encryption/lib/keymanager.php
apps/files_encryption/lib/proxy.php

index 9bb854325de0c28cc429e011439d6e0a8fd25503..e911c1785df5f74c89eecc8abd679b4e8b5f0bcb 100755 (executable)
@@ -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;
 
index 5e3c567413388dec58395933cdbdae3f31c0ad6c..23faab4c3b2036659cbb418822f1d4bff3f52027 100644 (file)
@@ -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;