in case the file exists we require the explicit module as specified in the file header - otherwise we need to fail hard to prevent data loss on client side

This commit is contained in:
Thomas Müller 2015-04-01 16:35:46 +02:00
parent de4ec21c39
commit c9d6ed3d7d
1 changed files with 6 additions and 0 deletions

View File

@ -219,6 +219,12 @@ class Encryption extends Wrapper {
$size = $unencryptedSize = 0; $size = $unencryptedSize = 0;
if ($this->file_exists($path)) { if ($this->file_exists($path)) {
// in case the file exists we require the explicit module as
// specified in the file header - otherwise we need to fail hard to
// prevent data loss on client side
if (!empty($encryptionModuleId)) {
$encryptionModule = $this->encryptionManager->getEncryptionModule($encryptionModuleId);
}
$size = $this->storage->filesize($path); $size = $this->storage->filesize($path);
$unencryptedSize = $this->filesize($path); $unencryptedSize = $this->filesize($path);
} }