1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-02-24 12:03:21 +01:00

[ticket/12536] Get Versions Should Not Require Both Stable and Unstable

https://tracker.phpbb.com/browse/PHPBB3-12536

PHPBB3-12536
This commit is contained in:
Tristan Darricau 2014-05-12 23:47:05 +02:00
parent b62c39c36e
commit 36d5fff1c6

View File

@ -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';
}
return ($this->is_stable($this->current_version)) ? $info['stable'] : $info['unstable'];
if (!isset($info[$stability]))
{
throw new \RuntimeException($this->user->lang('VERSIONCHECK_FAIL'));
}
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');