diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-03-14 14:04:30 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-03-14 14:04:30 +0100 |
commit | 0aa23d203ef8760bd4f536b4eeaa6e9022c68eee (patch) | |
tree | 725cca559d663efe32e9864514ff75b787d1cd57 /phpBB/includes/acp/acp_main.php | |
parent | c743e28b94e2764b23c6e7da0e8e8d3452aec71e (diff) | |
parent | 60d2c1f4006894f2bb4fa310372734d02565e9ca (diff) | |
download | forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.tar forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.tar.gz forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.tar.bz2 forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.tar.xz forums-0aa23d203ef8760bd4f536b4eeaa6e9022c68eee.zip |
Merge remote-tracking branch 'EXreaction/ticket/9871-2' into develop
* EXreaction/ticket/9871-2:
[ticket/9871] Can set current version to use instead of the phpBB version
[ticket/9871] Fix indentation on comment
[ticket/9871] Fix test name
[ticket/9871] Split fast and slow version tests
[ticket/9871] Option to force the stability when checking for updates
[ticket/9871] Allow setting the host/file to load for the version class
[ticket/9871] Restore get_remote_file_test
[ticket/9871] Fix tests
[ticket/9871] Typehint and comment on var types
[ticket/9871] Mark test as slow
[ticket/9871] Restore phpbb_version_compare
[ticket/9871] Restore get_remote_file
[ticket/9871] Use $request->variable instead of request_var
[ticket/9871] Update version check file to use json format
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..fd45027b49 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->variable('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() : '', )); } |