Merge pull request #4757 from VSEphpbb/ticket/15143

[ticket/15143] Fix display of version update in ACP

* github.com:phpbb/phpbb:
  [ticket/15143] Fix display of version update in ACP
This commit is contained in:
Tristan Darricau 2017-03-24 23:18:50 +01:00
commit 827ded82b8
No known key found for this signature in database
GPG key ID: 817043C2E29DB881
2 changed files with 6 additions and 9 deletions

View file

@ -51,10 +51,7 @@ class acp_update
$updates_available = array(); $updates_available = array();
} }
foreach ($updates_available as $branch => $version_data) $template->assign_block_vars('updates_available', $updates_available);
{
$template->assign_block_vars('updates_available', $version_data);
}
$update_link = append_sid($phpbb_root_path . 'install/'); $update_link = append_sid($phpbb_root_path . 'install/');

View file

@ -184,7 +184,7 @@ class version_helper
$self = $this; $self = $this;
$current_version = $this->current_version; $current_version = $this->current_version;
// Filter out any versions less than to the current version // Filter out any versions less than the current version
$versions = array_filter($versions, function($data) use ($self, $current_version) { $versions = array_filter($versions, function($data) use ($self, $current_version) {
return $self->compare($data['current'], $current_version, '>='); return $self->compare($data['current'], $current_version, '>=');
}); });
@ -218,7 +218,7 @@ class version_helper
$self = $this; $self = $this;
$current_version = $this->current_version; $current_version = $this->current_version;
// Filter out any versions less than to the current version // Filter out any versions less than the current version
$versions = array_filter($versions, function($data) use ($self, $current_version) { $versions = array_filter($versions, function($data) use ($self, $current_version) {
return $self->compare($data['current'], $current_version, '>='); return $self->compare($data['current'], $current_version, '>=');
}); });
@ -248,7 +248,7 @@ class version_helper
* *
* @param bool $force_update Ignores cached data. Defaults to false. * @param bool $force_update Ignores cached data. Defaults to false.
* @param bool $force_cache Force the use of the cache. Override $force_update. * @param bool $force_cache Force the use of the cache. Override $force_update.
* @return string * @return array
* @throws \RuntimeException * @throws \RuntimeException
*/ */
public function get_suggested_updates($force_update = false, $force_cache = false) public function get_suggested_updates($force_update = false, $force_cache = false)
@ -269,7 +269,7 @@ class version_helper
* *
* @param bool $force_update Ignores cached data. Defaults to false. * @param bool $force_update Ignores cached data. Defaults to false.
* @param bool $force_cache Force the use of the cache. Override $force_update. * @param bool $force_cache Force the use of the cache. Override $force_update.
* @return string Version info * @return array Version info
* @throws \RuntimeException * @throws \RuntimeException
*/ */
public function get_versions_matching_stability($force_update = false, $force_cache = false) public function get_versions_matching_stability($force_update = false, $force_cache = false)
@ -289,7 +289,7 @@ class version_helper
* *
* @param bool $force_update Ignores cached data. Defaults to false. * @param bool $force_update Ignores cached data. Defaults to false.
* @param bool $force_cache Force the use of the cache. Override $force_update. * @param bool $force_cache Force the use of the cache. Override $force_update.
* @return string Version info, includes stable and unstable data * @return array Version info, includes stable and unstable data
* @throws \RuntimeException * @throws \RuntimeException
*/ */
public function get_versions($force_update = false, $force_cache = false) public function get_versions($force_update = false, $force_cache = false)