consolidation of boolean expression

This commit is contained in:
Jasper Knockaert 2021-01-16 14:33:44 +01:00 committed by MichaIng (Rebase PR Action)
parent 5341807b14
commit 5f9663d2c8

View file

@ -937,11 +937,8 @@ class Encryption extends Wrapper {
// if the header doesn't contain a encryption module we check if it is a
// legacy file. If true, we add the default encryption module
if (!isset($result[Util::HEADER_ENCRYPTION_MODULE_KEY])) {
if (!empty($result)) {
$result[Util::HEADER_ENCRYPTION_MODULE_KEY] = 'OC_DEFAULT_MODULE';
} elseif ($exists) {
$result[Util::HEADER_ENCRYPTION_MODULE_KEY] = 'OC_DEFAULT_MODULE';
if (!isset($result[Util::HEADER_ENCRYPTION_MODULE_KEY] && (!empty($result) || $exists)) {
$result[Util::HEADER_ENCRYPTION_MODULE_KEY] = 'OC_DEFAULT_MODULE';
}
}
}