[Pkg-owncloud-commits] [owncloud] 15/165: if we start writing a file from the beginning, size should start by zero; result of floor needs to be casted to int in order to compare it with ->size

David Prévot taffit at moszumanska.debian.org
Thu Apr 23 04:06:15 UTC 2015


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch stable8
in repository owncloud.

commit 67500d5f2fa9eae33a33095b3e0ddc723dae69c5
Author: Bjoern Schiessle <schiessle at owncloud.com>
Date:   Wed Apr 15 13:17:01 2015 +0200

    if we start writing a file from the beginning, size should start by zero; result of floor needs to be casted to int in order to compare it with ->size
---
 lib/private/files/stream/encryption.php | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php
index 9ba98e6..4a1df84 100644
--- a/lib/private/files/stream/encryption.php
+++ b/lib/private/files/stream/encryption.php
@@ -280,7 +280,7 @@ class Encryption extends Wrapper {
 
 		if ($this->position === 0) {
 			$this->writeHeader();
-			$this->size+=$this->util->getHeaderSize();
+			$this->size = $this->util->getHeaderSize();
 		}
 
 		$length = 0;
@@ -293,7 +293,7 @@ class Encryption extends Wrapper {
 
 			// for seekable streams the pointer is moved back to the beginning of the encrypted block
 			// flush will start writing there when the position moves to another block
-			$positionInFile = floor($this->position / $this->unencryptedBlockSize) *
+			$positionInFile = (int)floor($this->position / $this->unencryptedBlockSize) *
 				$this->util->getBlockSize() + $this->util->getHeaderSize();
 			$resultFseek = parent::stream_seek($positionInFile);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-owncloud/owncloud.git



More information about the Pkg-owncloud-commits mailing list