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:
james 2008-09-02 17:34:32 +00:00
parent 5fd8680f4e
commit 7dcb9ef8b0
2 changed files with 3 additions and 3 deletions

View File

@ -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!"));

View File

@ -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 */