From 373ceecebbf3a82f5c951be52e48ba96511c6676 Mon Sep 17 00:00:00 2001 From: Darshan Date: Sun, 20 Jul 2025 16:40:29 +0530 Subject: [PATCH] fix: add a default client name for session alerts --- app/controllers/api/account.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index b8860b1a17..ec951bb747 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -132,6 +132,12 @@ function sendSessionAlert(Locale $locale, Document $user, Document $project, Doc ->setSmtpSenderName($senderName); } + // making sure that the session alerts always have a client name! + if (isset($session['clientName']) && empty($session['clientName'])) { + // fallback to the user agent and then unknown! + $session['clientName'] = !empty($session['userAgent']) ? $session['userAgent'] : 'UNKNOWN'; + } + $emailVariables = [ 'direction' => $locale->getText('settings.direction'), 'date' => (new \DateTime())->format('F j'),