aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--phpBB/phpbb/version_helper.php5
-rw-r--r--tests/version/version_test.php10
2 files changed, 14 insertions, 1 deletions
diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php
index e2fdf6ce63..76bd477e18 100644
--- a/phpBB/phpbb/version_helper.php
+++ b/phpBB/phpbb/version_helper.php
@@ -247,7 +247,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');
@@ -263,6 +263,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
}
diff --git a/tests/version/version_test.php b/tests/version/version_test.php
index 2e2398bd45..5caad46e10 100644
--- a/tests/version/version_test.php
+++ b/tests/version/version_test.php
@@ -181,6 +181,11 @@ class phpbb_version_helper_test extends phpbb_test_case
),
),
),
+ array(
+ '1.1.0',
+ array(),
+ array(),
+ ),
);
}
@@ -286,6 +291,11 @@ class phpbb_version_helper_test extends phpbb_test_case
),
'1.1.0-a2',
),
+ array(
+ '1.1.0',
+ array(),
+ null,
+ ),
);
}