diff options
author | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-21 11:48:15 +0300 |
---|---|---|
committer | Thomas Müller <thomas.mueller@tmit.eu> | 2016-03-21 11:48:15 +0300 |
commit | fefaa1fd8736d270e007c697ad65e594bd4deb8f (patch) | |
tree | 9c5a5eec6008b8dfd6ef7e929c71d449dfa5075d /lib | |
parent | ce0f68c7ce45563a789cfeee3d2c6ebe73e65d57 (diff) | |
parent | f9ad57ee523db315e49f08ae4d28b592d32cc8c9 (diff) |
Merge pull request #23293 from owncloud/backport-23108
[stable9] Ensure that stored version is at least 1 for cross-storage copy
Diffstat (limited to 'lib')
-rw-r--r-- | lib/private/files/storage/wrapper/encryption.php | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/private/files/storage/wrapper/encryption.php b/lib/private/files/storage/wrapper/encryption.php index 0b4816174bf..81eea9944f8 100644 --- a/lib/private/files/storage/wrapper/encryption.php +++ b/lib/private/files/storage/wrapper/encryption.php @@ -634,7 +634,18 @@ class Encryption extends Wrapper { 'encrypted' => (bool)$isEncrypted, ]; if($isEncrypted === 1) { - $cacheInformation['encryptedVersion'] = $sourceStorage->getCache()->get($sourceInternalPath)['encryptedVersion']; + $encryptedVersion = $sourceStorage->getCache()->get($sourceInternalPath)['encryptedVersion']; + + // In case of a move operation from an unencrypted to an encrypted + // storage the old encrypted version would stay with "0" while the + // correct value would be "1". Thus we manually set the value to "1" + // for those cases. + // See also https://github.com/owncloud/core/issues/23078 + if($encryptedVersion === 0) { + $encryptedVersion = 1; + } + + $cacheInformation['encryptedVersion'] = $encryptedVersion; } // in case of a rename we need to manipulate the source cache because |