Skip to content

Commit 7c1250e

Browse files
committed
Merge branch 'security-enforceUpgrade' into dev33
2 parents 46ae385 + d4ee3cf commit 7c1250e

File tree

3 files changed

+22
-6
lines changed

3 files changed

+22
-6
lines changed

public_html/lists/admin/connect.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -503,17 +503,22 @@ function Fatal_Error($msg, $documentationURL = '')
503503
$_SESSION['fatalerror'] = 0;
504504
}
505505
++$_SESSION['fatalerror'];
506-
header('HTTP/1.0 509 Fatal error');
506+
header('HTTP/1.0 500 Fatal error');
507507
if ($_SESSION['fatalerror'] > 5) {
508508
$_SESSION['logout_error'] = s('Too many errors, please login again');
509+
$_SESSION['adminloggedin'] = '';
510+
$_SESSION['logindetails'] = '';
511+
session_destroy();
509512
Redirect('logout&err=2');
513+
exit;
510514
}
511515

512516
if ($GLOBALS['commandline']) {
513517
@ob_end_clean();
514518
echo "\n".$GLOBALS['I18N']->get('fatalerror').': '.strip_tags($msg)."\n";
515519
@ob_start();
516520
} else {
521+
@ob_end_clean();
517522
if (isset($GLOBALS['I18N']) && is_object($GLOBALS['I18N'])) {
518523
echo '<div align="center" class="error">'.$GLOBALS['I18N']->get('fatalerror').": $msg ";
519524
} else {

public_html/lists/admin/home.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
// check for latest version
3333
$checkinterval = sprintf('%d', getConfig('check_new_version'));
34-
if (!isset($checkinterval)) {
34+
if (empty($checkinterval)) {
3535
$checkinterval = 7;
3636
}
3737

@@ -67,11 +67,11 @@
6767

6868
if ($showUpdateAvail) {
6969
echo '<div class="newversion note">';
70-
echo $GLOBALS['I18N']->get('A new version of phpList is available!');
70+
echo s('A new version of phpList is available!');
7171
echo '<br/>';
72-
echo '<br/>'.$GLOBALS['I18N']->get('The new version may have fixed security issues,<br/>so it is recommended to upgrade as soon as possible');
73-
echo '<br/>'.$GLOBALS['I18N']->get('Your version').': <b>'.$thisversion.'</b>';
74-
echo '<br/>'.$GLOBALS['I18N']->get('Latest version').': <b>'.$latestversion.'</b><br/> ';
72+
echo '<br/>'.s('The new version may have fixed security issues,<br/>so it is recommended to upgrade as soon as possible');
73+
echo '<br/>'.s('Your version').': <b>'.$thisversion.'</b>';
74+
echo '<br/>'.s('Latest version').': <b>'.$latestversion.'</b><br/> ';
7575
echo '<a href="https://www.phplist.com/latestchanges?utm_source=pl'.$thisversion.'&amp;utm_medium=updatenews&amp;utm_campaign=phpList" title="'.s('Read what has changed in the new version').'" target="_blank">'.$GLOBALS['I18N']->get('View what has changed').'</a>&nbsp;&nbsp;';
7676
echo '<a href="https://www.phplist.com/download?utm_source=pl'.$thisversion.'&amp;utm_medium=updatedownload&amp;utm_campaign=phpList" title="'.s('Download the new version').'" target="_blank">'.$GLOBALS['I18N']->get('Download').'</a></div>';
7777
}

public_html/lists/admin/index.php

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,6 +490,17 @@ function mb_strtolower($string)
490490
if (version_compare(PHP_VERSION, '5.4.0', '<') && WARN_ABOUT_PHP_SETTINGS) {
491491
Error(s('Your PHP version is out of date. phpList requires PHP version 5.4.0 or higher.'));
492492
}
493+
if (defined('RELEASEDATE') && ((time() - RELEASEDATE) / 31536000) > 2) {
494+
Fatal_Error(s('Your phpList version is older than two years. Please %supgrade phpList</a> before continuing.</br>
495+
Visit <a href="https://www.phplist.org/users/" title="'.s('Get some help').'">the support site</a> if you need some help.'
496+
,'<a href="https://www.phplist.com/download?utm_source=pl'.VERSION.'&amp;utm_medium=outdated-download-forced&amp;utm_campaign=phpList" title="'.s('Download the latest version').'" target="_blank">'));
497+
return;
498+
}
499+
500+
if (!defined('PHP_VERSION_ID') || PHP_VERSION_ID < 50300) {
501+
Fatal_Error(s('Your PHP version is too old. Please upgrade PHP before continuing'));
502+
return;
503+
}
493504
if (defined('ENABLE_RSS') && ENABLE_RSS && !function_exists('xml_parse') && WARN_ABOUT_PHP_SETTINGS) {
494505
Warn($GLOBALS['I18N']->get('You are trying to use RSS, but XML is not included in your PHP'));
495506
}

0 commit comments

Comments
 (0)