Fixing encryption stream wrapper seek - thanks @jknockaert

This commit is contained in:
jknockaert 2015-04-02 14:52:54 +02:00 committed by Thomas Müller
parent 104d11ec4c
commit 02404a6a8c
1 changed files with 3 additions and 0 deletions

View File

@ -362,8 +362,11 @@ class Encryption extends Wrapper {
$newFilePosition = floor($newPosition / $this->unencryptedBlockSize)
* $this->util->getBlockSize() + $this->util->getHeaderSize();
$oldFilePosition = parent::stream_tell();
if (parent::stream_seek($newFilePosition)) {
parent::stream_seek($oldFilePosition);
$this->flush();
parent::stream_seek($newFilePosition);
$this->position = $newPosition;
$return = true;
}