]> git.p6c8.net - jirafeau/jirafeau.git/blobdiff - lib/functions.php
Fixed temporary filenames of encrypted files during classic upload
[jirafeau/jirafeau.git] / lib / functions.php
index 0d660667bdb660f0a46904d7198e58a7667d6401..e5a05b0e559ebe520eb7e99b4a06f96c061a5bbd 100644 (file)
@@ -464,9 +464,9 @@ function jirafeau_handle_add_file_encryption($crypt_module_enabled, $file_path)
         error_log("PHP extension sodium not loaded, won't encrypt in Jirafeau");
     }
     if ($crypt_module_enabled == true && extension_loaded('sodium') == true) {
         error_log("PHP extension sodium not loaded, won't encrypt in Jirafeau");
     }
     if ($crypt_module_enabled == true && extension_loaded('sodium') == true) {
-        $crypt_key = jirafeau_encrypt_file($file_path, $file_path.'crypt');
+        $crypt_key = jirafeau_encrypt_file($file_path, $file_path.'.crypt');
         if (strlen($crypt_key) > 0) {
         if (strlen($crypt_key) > 0) {
-            if (rename($file_path.'crypt', $file_path) === true) {
+            if (rename($file_path.'.crypt', $file_path) === true) {
                 $crypted = true;
             }
         }
                 $crypted = true;
             }
         }

patrick-canterino.de