aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/phpbb/version_helper.php
diff options
context:
space:
mode:
authorTristan Darricau <github@nicofuma.fr>2014-05-15 01:14:44 +0200
committerTristan Darricau <github@nicofuma.fr>2014-05-15 01:14:44 +0200
commite1d9f1c67c9be90ac2f7f6a86ed02f0c22622afa (patch)
tree489546b79c5751cddedba9d11c754a58f7dd61b4 /phpBB/phpbb/version_helper.php
parent8b6df0e2f8a0601b43a1c1186f09bf058dadb47b (diff)
downloadforums-e1d9f1c67c9be90ac2f7f6a86ed02f0c22622afa.tar
forums-e1d9f1c67c9be90ac2f7f6a86ed02f0c22622afa.tar.gz
forums-e1d9f1c67c9be90ac2f7f6a86ed02f0c22622afa.tar.bz2
forums-e1d9f1c67c9be90ac2f7f6a86ed02f0c22622afa.tar.xz
forums-e1d9f1c67c9be90ac2f7f6a86ed02f0c22622afa.zip
[ticket/12536] Use stable values when unstable are unavailable
PHPBB3-12536
Diffstat (limited to 'phpBB/phpbb/version_helper.php')
-rw-r--r--phpBB/phpbb/version_helper.php16
1 files changed, 5 insertions, 11 deletions
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
}