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
This commit is contained in:
parent
d2ef73367c
commit
67500d5f2f
1 changed files with 2 additions and 2 deletions
|
@ -280,7 +280,7 @@ class Encryption extends Wrapper {
|
||||||
|
|
||||||
if ($this->position === 0) {
|
if ($this->position === 0) {
|
||||||
$this->writeHeader();
|
$this->writeHeader();
|
||||||
$this->size+=$this->util->getHeaderSize();
|
$this->size = $this->util->getHeaderSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
$length = 0;
|
$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
|
// 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
|
// 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();
|
$this->util->getBlockSize() + $this->util->getHeaderSize();
|
||||||
$resultFseek = parent::stream_seek($positionInFile);
|
$resultFseek = parent::stream_seek($positionInFile);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue