From 40e9fa9b368242aeed188a91e640c5c23e3af3c0 Mon Sep 17 00:00:00 2001 From: Bradley Schofield Date: Thu, 17 Jun 2021 10:08:01 +0100 Subject: [PATCH] Add Christy's Suggestions --- app/controllers/api/account.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/account.php b/app/controllers/api/account.php index 2e8fb1a5c..1f6f99199 100644 --- a/app/controllers/api/account.php +++ b/app/controllers/api/account.php @@ -878,9 +878,11 @@ App::get('/v1/account/sessions') foreach ($sessions as $key => $session) { /** @var Document $session */ - $session->setAttribute('countryName', (isset($countries[strtoupper($session->getAttribute('countryCode'))])) - ? $countries[strtoupper($session->getAttribute('countryCode'))] - : $locale->getText('locale.country.unknown')); + $countryName = (isset($countries[strtoupper($session->getAttribute('countryCode'))])) + ? $countries[strtoupper($session->getAttribute('countryCode'))] + : $locale->getText('locale.country.unknown'); + + $session->setAttribute('countryName', $countryName); $session->setAttribute('current', ($current == $session->getId()) ? true : false); $sessions[$key] = $session;