summaryrefslogtreecommitdiffstats
path: root/lib/private/files/storage/wrapper/encryption.php
diff options
context:
space:
mode:
authorBjoern Schiessle <schiessle@owncloud.com>2015-06-23 10:43:28 +0200
committerBjoern Schiessle <schiessle@owncloud.com>2015-06-23 11:41:21 +0200
commit95602d4069a1eb9a45e1d08edeecc0d5b90e01ca (patch)
tree603ebb3f664104b2d8bcdb939417155109ab3b1d /lib/private/files/storage/wrapper/encryption.php
parented3dc199ae406aba2214ebd7751ef0434501db3b (diff)
downloadnextcloud-server-95602d4069a1eb9a45e1d08edeecc0d5b90e01ca.tar.gz
nextcloud-server-95602d4069a1eb9a45e1d08edeecc0d5b90e01ca.zip
make sure that we always read the header from the original file
Diffstat (limited to 'lib/private/files/storage/wrapper/encryption.php')
-rw-r--r--lib/private/files/storage/wrapper/encryption.php8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php
index 056f823c18b..8d1f80c53c0 100644
--- a/lib/private/files/storage/wrapper/encryption.php
+++ b/lib/private/files/storage/wrapper/encryption.php
@@ -349,7 +349,8 @@ class Encryption extends Wrapper {
if ($this->util->isExcluded($fullPath) === false) {
$size = $unencryptedSize = 0;
- $targetExists = $this->file_exists($path);
+ $realFile = $this->util->stripPartialFileExtension($path);
+ $targetExists = $this->file_exists($realFile);
$targetIsEncrypted = false;
if ($targetExists) {
// in case the file exists we require the explicit module as
@@ -605,8 +606,9 @@ class Encryption extends Wrapper {
*/
protected function getHeader($path) {
$header = '';
- if ($this->storage->file_exists($path)) {
- $handle = $this->storage->fopen($path, 'r');
+ $realFile = $this->util->stripPartialFileExtension($path);
+ if ($this->storage->file_exists($realFile)) {
+ $handle = $this->storage->fopen($realFile, 'r');
$firstBlock = fread($handle, $this->util->getHeaderSize());
fclose($handle);
if (substr($firstBlock, 0, strlen(Util::HEADER_START)) === Util::HEADER_START) {