From 4d8a0bbb1678568213f8c19c6542f933720bc983 Mon Sep 17 00:00:00 2001 From: Joas Schilling Date: Fri, 8 Dec 2023 08:08:30 +0100 Subject: [PATCH] fix(mail): Fix mail handling when force_language is true or false Signed-off-by: Joas Schilling --- lib/MailNotifications.php | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/MailNotifications.php b/lib/MailNotifications.php index 747b9e097..7fdf7c5d6 100644 --- a/lib/MailNotifications.php +++ b/lib/MailNotifications.php @@ -136,11 +136,13 @@ public function sendEmails(int $batchSize, int $sendTime): void { $userEnabled = $this->config->getUserValueForUsers('core', 'enabled', $userIds); $fallbackLang = $this->config->getSystemValue('force_language', null); - if ($fallbackLang === null) { - $fallbackLang = $this->config->getSystemValue('default_language', 'en'); - $userLanguages = $this->config->getUserValueForUsers('core', 'lang', $userIds); - } else { + if (is_string($fallbackLang)) { + /** @psalm-var array $userLanguages */ $userLanguages = []; + } else { + $fallbackLang = $this->config->getSystemValueString('default_language', 'en'); + /** @psalm-var array $userLanguages */ + $userLanguages = $this->config->getUserValueForUsers('core', 'lang', $userIds); } foreach ($userSettings as $settings) {