[ticket/12536] Use stable values when unstable are unavailable

PHPBB3-12536
This commit is contained in:
Tristan Darricau 2014-05-15 01:14:44 +02:00
parent 8b6df0e2f8
commit e1d9f1c67c

View file

@ -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';
return ($this->force_stability === 'unstable') ? $info['unstable'] : $info['stable'];
}
if (!isset($info[$stability]))
{
return array();
}
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
}