forked from science-ation/science-ation
Fix the config variables rollover so it uses the previous year's data instead of the defaults!
Also add some intval()'s for rollover year sanity checking
This commit is contained in:
parent
5fd8680f4e
commit
7dcb9ef8b0
@ -56,8 +56,8 @@
|
||||
|
||||
if($_POST['action']=="rollover" && $_POST['nextfairyear'])
|
||||
{
|
||||
$newfairyear=$_POST['nextfairyear'];
|
||||
$currentfairyear=$config['FAIRYEAR'];
|
||||
$newfairyear=intval($_POST['nextfairyear']);
|
||||
$currentfairyear=intval($config['FAIRYEAR']);
|
||||
|
||||
if($newfairyear<$currentfairyear)
|
||||
echo error(i18n("You cannot roll backwards in years!"));
|
||||
|
@ -93,7 +93,7 @@ function config_update_variables($fairyear=NULL, $lastfairyear=NULL)
|
||||
WHERE config.var='$var'
|
||||
AND (config.year='$lastfairyear'
|
||||
OR config.year='-1')
|
||||
ORDER BY config.year";
|
||||
ORDER BY config.year DESC";
|
||||
$r2 = mysql_query($q);
|
||||
if(mysql_num_rows($r2) < 1) {
|
||||
/* Uhoh, this shouldn't happen */
|
||||
|
Loading…
Reference in New Issue
Block a user