From e1d9f1c67c9be90ac2f7f6a86ed02f0c22622afa Mon Sep 17 00:00:00 2001 From: Tristan Darricau Date: Thu, 15 May 2014 01:14:44 +0200 Subject: [ticket/12536] Use stable values when unstable are unavailable PHPBB3-12536 --- phpBB/phpbb/version_helper.php | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'phpBB/phpbb/version_helper.php') diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php index 8e1c593094..4718088ab6 100644 --- a/phpBB/phpbb/version_helper.php +++ b/phpBB/phpbb/version_helper.php @@ -215,19 +215,10 @@ class version_helper if ($this->force_stability !== null) { - $stability = ($this->force_stability === 'unstable') ? 'unstable' : 'stable'; - } - else - { - $stability = $this->is_stable($this->current_version) ? 'stable' : 'unstable'; - } - - if (!isset($info[$stability])) - { - return array(); + return ($this->force_stability === 'unstable') ? $info['unstable'] : $info['stable']; } - return $info[$stability]; + return ($this->is_stable($this->current_version)) ? $info['stable'] : $info['unstable']; } /** @@ -271,6 +262,9 @@ class version_helper } } + $info['stable'] = (empty($info['stable'])) ? array() : $info['stable']; + $info['unstable'] = (empty($info['unstable'])) ? $info['stable'] : $info['unstable']; + $this->cache->put($cache_file, $info, 86400); // 24 hours } -- cgit v1.2.1