fix(encryption): Take encryption enabled status into account

shouldEncrypt now returns false for all paths if encryption is disabled.

Signed-off-by: Côme Chilliet <come.chilliet@nextcloud.com>
This commit is contained in:
Côme Chilliet 2025-09-02 17:48:01 +02:00 committed by backportbot[bot]
parent 813507ebd2
commit 0ce7c1e47f

View file

@ -446,7 +446,7 @@ class Encryption extends Wrapper {
}
// encryption disabled on write of new file and write to existing unencrypted file -> don't encrypt
if (!$encryptionEnabled || !$this->shouldEncrypt($path)) {
if (!$this->shouldEncrypt($path)) {
if (!$targetExists || !$targetIsEncrypted) {
$shouldEncrypt = false;
}