summaryrefslogtreecommitdiffstats
path: root/lib/filecache.php
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-06-21 17:37:53 +0200
committerRobin Appelman <icewind@owncloud.com>2012-06-21 17:38:00 +0200
commitd0455c5819099751fb8614a76c272a23c6494b65 (patch)
treec6068672ac891b51e1ae690515a897995ac9039d /lib/filecache.php
parent1338279ca02af2444a7277a041bec18aab615774 (diff)
downloadnextcloud-server-d0455c5819099751fb8614a76c272a23c6494b65.tar.gz
nextcloud-server-d0455c5819099751fb8614a76c272a23c6494b65.zip
truncate decrypted files based on filelength
Diffstat (limited to 'lib/filecache.php')
-rw-r--r--lib/filecache.php10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/filecache.php b/lib/filecache.php
index 9963a5a3baf..d5458834e08 100644
--- a/lib/filecache.php
+++ b/lib/filecache.php
@@ -68,18 +68,18 @@ class OC_FileCache{
$path=$root.$path;
$parent=self::getParentId($path);
$id=self::getId($path,'');
- if($id!=-1){
- self::update($id,$data);
- return;
- }
if(isset(OC_FileCache_Cached::$savedData[$path])){
- $data=array_merge($data,OC_FileCache_Cached::$savedData[$path]);
+ $data=array_merge(OC_FileCache_Cached::$savedData[$path],$data);
unset(OC_FileCache_Cached::$savedData[$path]);
}
if(!isset($data['size']) or !isset($data['mtime'])){//save incomplete data for the next time we write it
OC_FileCache_Cached::$savedData[$path]=$data;
return;
}
+ if($id!=-1){
+ self::update($id,$data);
+ return;
+ }
if(!isset($data['encrypted'])){
$data['encrypted']=false;
}