diff options
author | Morris Jobke <hey@morrisjobke.de> | 2018-07-09 15:46:06 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-07-09 15:46:06 +0300 |
commit | 83d99449d0c6289bd1fa0763fb2ae088c0840f89 (patch) | |
tree | a7d4427bd5aa51b1f187352a330927010ea65922 /lib | |
parent | 486dff093453b402324b25a63554fcb10fb18e41 (diff) | |
parent | 3a45bb52bc24fd13c63c03486b78d7bc3f798942 (diff) |
Merge pull request #10121 from nextcloud/stable13-allow-disable-encryption
[stable13] allow to disable encryption
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/Files/Storage/Wrapper/Encryption.php | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/lib/private/Files/Storage/Wrapper/Encryption.php b/lib/private/Files/Storage/Wrapper/Encryption.php index 685ecc837bd..1baea1e476c 100644 --- a/lib/private/Files/Storage/Wrapper/Encryption.php +++ b/lib/private/Files/Storage/Wrapper/Encryption.php @@ -414,9 +414,13 @@ class Encryption extends Wrapper { || $mode === 'wb' || $mode === 'wb+' ) { - // don't overwrite encrypted files if encryption is not enabled + // if we update a encrypted file with a un-encrypted one we change the db flag if ($targetIsEncrypted && $encryptionEnabled === false) { - throw new GenericEncryptionException('Tried to access encrypted file but encryption is not enabled'); + $cache = $this->storage->getCache(); + if ($cache) { + $entry = $cache->get($path); + $cache->update($entry->getId(), ['encrypted' => 0]); + } } if ($encryptionEnabled) { // if $encryptionModuleId is empty, the default module will be used |