summaryrefslogtreecommitdiffstats
path: root/lib/private/files/stream
diff options
context:
space:
mode:
authorjknockaert <jasper@knockaert.nl>2015-04-02 14:52:54 +0200
committerThomas Müller <thomas.mueller@tmit.eu>2015-04-07 13:30:30 +0200
commit02404a6a8cd07ca79add601deaefe3b4940eddfa (patch)
tree3f9e7d023570e64b39f55c9b63f70daf5a12a0e2 /lib/private/files/stream
parent104d11ec4c5d359c54985e01c171ba1845537632 (diff)
downloadnextcloud-server-02404a6a8cd07ca79add601deaefe3b4940eddfa.tar.gz
nextcloud-server-02404a6a8cd07ca79add601deaefe3b4940eddfa.zip
Fixing encryption stream wrapper seek - thanks @jknockaert
Diffstat (limited to 'lib/private/files/stream')
-rw-r--r--lib/private/files/stream/encryption.php3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/private/files/stream/encryption.php b/lib/private/files/stream/encryption.php
index fcc9984500d..fdfe73d99c5 100644
--- a/lib/private/files/stream/encryption.php
+++ b/lib/private/files/stream/encryption.php
@@ -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;
}