Commit d8ccf36d authored by Menno Dekker's avatar Menno Dekker

Fixed #7936: stable version shows beta update while only stable requested

dev: still need to fix beta channel, maybe need different setting for report beta/stable/both on manual check. 
parent 0304d683
......@@ -5702,20 +5702,36 @@ function updateCheck()
if (count($updateinfo) && trim(Yii::app()->getConfig('buildnumber'))!='')
{
setGlobalSetting('updateversions',json_encode($updateinfo));
if (isset($updateinfo['master'])){
$updateinfo=$updateinfo['master'];
}
else
$sUpdateNotificationType = getGlobalSetting('updatenotification');
switch ($sUpdateNotificationType)
{
$updateinfo=reset($updateinfo);
case 'stable':
// Only show update if in stable (master) branch
if (isset($updateinfo['master'])) {
$updateinfo=$updateinfo['master'];
} else {
unset ($updateinfo);
}
break;
case 'both':
// Show first available update
$updateinfo=reset($updateinfo);
break;
default:
// Never show a notification
unset($updateinfo);
break;
}
}
if (isset($updateinfo)) {
setGlobalSetting('updateavailable',1);
setGlobalSetting('updatebuild',$updateinfo['build']);
setGlobalSetting('updateversion',$updateinfo['versionnumber']);
}
else
{
setGlobalSetting('updateavailable',0);
} else {
setGlobalSetting('updateavailable',0);
$updateinfo = array();
}
setGlobalSetting('updatelastcheck',date('Y-m-d H:i:s'));
return $updateinfo;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment