summaryrefslogtreecommitdiffstats
path: root/apps/files_encryption
diff options
context:
space:
mode:
authorRobin Appelman <icewind@owncloud.com>2012-06-21 18:07:56 +0200
committerRobin Appelman <icewind@owncloud.com>2012-06-21 18:22:18 +0200
commit56de98ed8cb74cc197d5b7cecdc519c2c267e3a5 (patch)
tree78b8362c0cadaeeb3621bc21a7eeb3db4208882d /apps/files_encryption
parentd0455c5819099751fb8614a76c272a23c6494b65 (diff)
downloadnextcloud-server-56de98ed8cb74cc197d5b7cecdc519c2c267e3a5.tar.gz
nextcloud-server-56de98ed8cb74cc197d5b7cecdc519c2c267e3a5.zip
fix saved file size for uploaded files
Diffstat (limited to 'apps/files_encryption')
-rw-r--r--apps/files_encryption/lib/cryptstream.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/apps/files_encryption/lib/cryptstream.php b/apps/files_encryption/lib/cryptstream.php
index 4ef7d1e08bb..e0020537563 100644
--- a/apps/files_encryption/lib/cryptstream.php
+++ b/apps/files_encryption/lib/cryptstream.php
@@ -115,8 +115,9 @@ class OC_CryptStream{
$data=substr($block,0,$currentPos%8192).$data;
fseek($this->source,-($currentPos%8192),SEEK_CUR);
}
- while(strlen($data)>0){
- if(strlen($data)<8192){
+ $currentPos=ftell($this->source);
+ while($remainingLength=strlen($data)>0){
+ if($remainingLength<8192){
$this->writeCache=$data;
$data='';
}else{
@@ -125,8 +126,7 @@ class OC_CryptStream{
$data=substr($data,8192);
}
}
- $currentPos=ftell($this->source);
- $this->size=max($this->size,$currentPos);
+ $this->size=max($this->size,$currentPos+$length);
return $length;
}