Skip to content

Commit 40bd2c0

Browse files
xh3n1Sam Tuke
authored andcommitted
Add config setting for RC candidates
Signed-off-by: Xheni Myrtaj <[email protected]>
1 parent 412e958 commit 40bd2c0

File tree

2 files changed

+13
-1
lines changed

2 files changed

+13
-1
lines changed

public_html/lists/admin/defaultconfig.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,13 @@
9898
'allowempty' => true,
9999
'category' => 'general',
100100
),
101+
'rc_notification' => array(
102+
'value' => 0,
103+
'description' => s('Show notification for Release Candidates'),
104+
'type' => 'boolean',
105+
'allowempty' => true,
106+
'category' => 'general',
107+
),
101108

102109
//# remote processing secret
103110
// @TODO previous value generation was limited to 20 hex characters (max), determine if this is enough (80 bits)

public_html/lists/admin/updateLib.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,14 @@ function checkForUpdate($path = '')
5555
{
5656
$serverResponse = getResponse($path);
5757
$version = isset($serverResponse['version']) ? $serverResponse['version'] : '';
58+
$enabledNotification = true;
59+
60+
if (strpos($version, 'RC') && (getConfig('rc_notification') == 0)) {
61+
$enabledNotification = false;
62+
}
5863
$versionString = isset($serverResponse['versionstring']) ? $serverResponse['versionstring'] : '';
5964

60-
if ($version !== '' && $version !== getCurrentphpListVersion($path) && version_compare(getCurrentphpListVersion($path), $version)) {
65+
if ($version !== '' && $version !== getCurrentphpListVersion($path) && version_compare(getCurrentphpListVersion($path), $version) && $enabledNotification) {
6166
$updateMessage = s('Update to ' . htmlentities($versionString) . ' is available. ');
6267
} else {
6368
$updateMessage = '';

0 commit comments

Comments
 (0)