From ed9756225d0dba15ed284822d7442d69283ac77d Mon Sep 17 00:00:00 2001 From: nupplaPhil Date: Sun, 2 Feb 2020 08:45:10 +0100 Subject: [PATCH] improvements --- include/enotify.php | 3 +-- src/Core/Update.php | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/include/enotify.php b/include/enotify.php index 4423a36a08..42aee55690 100644 --- a/include/enotify.php +++ b/include/enotify.php @@ -74,8 +74,7 @@ function notification($params) $sender_email = DI::emailer()->getSiteEmailAddress(); - $user = DBA::selectFirst('user', ['nickname', 'page-flags'], - ['uid' => $params['uid']]); + $user = User::getById($params['uid'], ['nickname', 'page-flags']); // There is no need to create notifications for forum accounts if (!DBA::isResult($user) || in_array($user["page-flags"], [User::PAGE_FLAGS_COMMUNITY, User::PAGE_FLAGS_PRVGROUP])) { diff --git a/src/Core/Update.php b/src/Core/Update.php index 2a3b3a68d6..b1e0a7cf17 100644 --- a/src/Core/Update.php +++ b/src/Core/Update.php @@ -252,7 +252,7 @@ class Update } $sent[] = $admin['email']; - $lang = (($admin['language']) ? $admin['language'] : 'en'); + $lang = $admin['language'] ?? 'en'; $l10n = DI::l10n()->withLang($lang); $preamble = Strings::deindent($l10n->t("