Skip to content
Snippets Groups Projects
Commit eaa4f922 authored by Florin Peter's avatar Florin Peter
Browse files

added our own file extension .part will not work here if we use...

added our own file extension .part will not work here if we use file_get_contents so we used our own extension '.etmp'
parent b3834b49
No related branches found
No related tags found
No related merge requests found
......@@ -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;
......
......@@ -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;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment