diff options
author | Nathan Guse <nathaniel.guse@gmail.com> | 2014-02-19 16:11:40 -0600 |
---|---|---|
committer | Nathan Guse <nathaniel.guse@gmail.com> | 2014-02-19 16:13:23 -0600 |
commit | 6c8589775b8df2b6fbeffbe594d9279ae90e85ba (patch) | |
tree | 170b26bd86dce0eeb7d6c447115f6810ced34bc2 /phpBB/includes/acp/acp_main.php | |
parent | bd8951cfbec799f685eb89f14a83933cee647112 (diff) | |
download | forums-6c8589775b8df2b6fbeffbe594d9279ae90e85ba.tar forums-6c8589775b8df2b6fbeffbe594d9279ae90e85ba.tar.gz forums-6c8589775b8df2b6fbeffbe594d9279ae90e85ba.tar.bz2 forums-6c8589775b8df2b6fbeffbe594d9279ae90e85ba.tar.xz forums-6c8589775b8df2b6fbeffbe594d9279ae90e85ba.zip |
[ticket/9871] Update version check file to use json format
PHPBB3-9871
Diffstat (limited to 'phpBB/includes/acp/acp_main.php')
-rw-r--r-- | phpBB/includes/acp/acp_main.php | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/phpBB/includes/acp/acp_main.php b/phpBB/includes/acp/acp_main.php index f01cba0bcc..579317d294 100644 --- a/phpBB/includes/acp/acp_main.php +++ b/phpBB/includes/acp/acp_main.php @@ -25,7 +25,7 @@ class acp_main function main($id, $mode) { global $config, $db, $cache, $user, $auth, $template, $request; - global $phpbb_root_path, $phpbb_admin_path, $phpEx; + global $phpbb_root_path, $phpbb_admin_path, $phpEx, $phpbb_container; // Show restore permissions notice if ($user->data['user_perm_from'] && $auth->acl_get('a_switchperm')) @@ -432,17 +432,19 @@ class acp_main )); } - $latest_version_info = false; - if (($latest_version_info = obtain_latest_version_info(request_var('versioncheck_force', false))) === false) + $version_helper = $phpbb_container->get('version_helper'); + try { - $template->assign_var('S_VERSIONCHECK_FAIL', true); + $recheck = request_var('versioncheck_force', false); + $updates_available = $version_helper->get_suggested_updates($recheck); + + $template->assign_var('S_VERSION_UP_TO_DATE', empty($updates_available)); } - else + catch (\RuntimeException $e) { - $latest_version_info = explode("\n", $latest_version_info); - $template->assign_vars(array( - 'S_VERSION_UP_TO_DATE' => phpbb_version_compare(trim($latest_version_info[0]), $config['version'], '<='), + 'S_VERSIONCHECK_FAIL' => true, + 'VERSIONCHECK_FAIL_REASON' => ($e->getMessage() !== $user->lang('VERSIONCHECK_FAIL')) ? $e->getMessage() : '', )); } |