From 9a5e51f43e2fe36329eba2190be9f3758c6ba312 Mon Sep 17 00:00:00 2001 From: Tadhg Boyle Date: Sat, 4 Jun 2022 09:42:30 -0600 Subject: [PATCH] Fix #2820 --- modules/Core/module.php | 2 +- modules/Core/pages/panel/update.php | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/modules/Core/module.php b/modules/Core/module.php index af4a585788..1f28f20b41 100644 --- a/modules/Core/module.php +++ b/modules/Core/module.php @@ -743,7 +743,7 @@ public function onPageLoad(User $user, Pages $pages, Cache $cache, Smarty $smart // Check for updates if ($user->isLoggedIn()) { - if ($user->hasPermission('admincp.update')) { + if ((defined('PANEL_PAGE') && PANEL_PAGE !== 'update') && $user->hasPermission('admincp.update')) { $cache->setCache('update_check'); if ($cache->isCached('update_check')) { $update_check = $cache->retrieve('update_check'); diff --git a/modules/Core/pages/panel/update.php b/modules/Core/pages/panel/update.php index 65f22fe28d..5f8b835b52 100644 --- a/modules/Core/pages/panel/update.php +++ b/modules/Core/pages/panel/update.php @@ -57,6 +57,16 @@ if (!is_string($update_check)) { if ($update_check->updateAvailable()) { $smarty->assign([ + 'NEW_UPDATE' => $update_check->isUrgent() + ? $language->get('admin', 'new_urgent_update_available') + : $language->get('admin', 'new_update_available'), + 'NEW_UPDATE_URGENT' => $update_check->isUrgent(), + 'CURRENT_VERSION' => $language->get('admin', 'current_version_x', [ + 'version' => Output::getClean(NAMELESS_VERSION) + ]), + 'NEW_VERSION' => $language->get('admin', 'new_version_x', [ + 'version' => Output::getClean($update_check->version()) + ]), 'INSTRUCTIONS' => $language->get('admin', 'instructions'), 'INSTRUCTIONS_VALUE' => Output::getDecoded($update_check->instructions()), 'UPGRADE_LINK' => URL::build('/panel/upgrade'),