aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-05-12 23:47:05 +0200
committerTristan Darricau <github@nicofuma.fr>2014-05-12 23:57:08 +0200
commit36d5fff1c6cbacbda4b4c623d8b9d909f214167a (patch)
treee51b43b5586761532b2d6b239a4dc125e82271b2 /phpBB/phpbb
parentb62c39c36e39d4b2fad1225106407a4083808ca0 (diff)
downloadforums-36d5fff1c6cbacbda4b4c623d8b9d909f214167a.tar
forums-36d5fff1c6cbacbda4b4c623d8b9d909f214167a.tar.gz
forums-36d5fff1c6cbacbda4b4c623d8b9d909f214167a.tar.bz2
forums-36d5fff1c6cbacbda4b4c623d8b9d909f214167a.tar.xz
forums-36d5fff1c6cbacbda4b4c623d8b9d909f214167a.zip
[ticket/12536] Get Versions Should Not Require Both Stable and Unstable
https://tracker.phpbb.com/browse/PHPBB3-12536 PHPBB3-12536
Diffstat (limited to 'phpBB/phpbb')
-rw-r--r--phpBB/phpbb/version_helper.php15
1 files changed, 12 insertions, 3 deletions
diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php
index e2fdf6ce63..7d59b5cd3a 100644
--- a/phpBB/phpbb/version_helper.php
+++ b/phpBB/phpbb/version_helper.php
@@ -216,10 +216,19 @@ class version_helper
if ($this->force_stability !== null)
{
- return ($this->force_stability === 'unstable') ? $info['unstable'] : $info['stable'];
+ $stability = ($this->force_stability === 'unstable') ? 'unstable' : 'stable';
+ }
+ else
+ {
+ $stability = $this->is_stable($this->current_version) ? 'stable' : 'unstable';
+ }
+
+ if (!isset($info[$stability]))
+ {
+ throw new \RuntimeException($this->user->lang('VERSIONCHECK_FAIL'));
}
- return ($this->is_stable($this->current_version)) ? $info['stable'] : $info['unstable'];
+ return $info[$stability];
}
/**
@@ -247,7 +256,7 @@ class version_helper
$info = json_decode($info, true);
- if (empty($info['stable']) || empty($info['unstable']))
+ if (empty($info['stable']) && empty($info['unstable']))
{
$this->user->add_lang('acp/common');