Fix numeric comparisons with undef
parent
105f285a63
commit
1abf35e1b5
|
@ -221,6 +221,10 @@ sub previousmonth($$$) {
|
||||||
my $month = shift;
|
my $month = shift;
|
||||||
my $archivebase = shift;
|
my $archivebase = shift;
|
||||||
|
|
||||||
|
if (not exists $wikistate{calendar}{minyear}) {
|
||||||
|
$wikistate{calendar}{minyear} = $year;
|
||||||
|
}
|
||||||
|
|
||||||
my $pmonth = $month;
|
my $pmonth = $month;
|
||||||
my $pyear = $year;
|
my $pyear = $year;
|
||||||
while ((not exists $pagesources{"$archivebase/$pyear/" . sprintf("%02d", $pmonth)}) or ($pmonth == $month and $pyear == $year)) {
|
while ((not exists $pagesources{"$archivebase/$pyear/" . sprintf("%02d", $pmonth)}) or ($pmonth == $month and $pyear == $year)) {
|
||||||
|
@ -239,6 +243,10 @@ sub nextmonth($$$) {
|
||||||
my $month = shift;
|
my $month = shift;
|
||||||
my $archivebase = shift;
|
my $archivebase = shift;
|
||||||
|
|
||||||
|
if (not exists $wikistate{calendar}{maxyear}) {
|
||||||
|
$wikistate{calendar}{maxyear} = $year;
|
||||||
|
}
|
||||||
|
|
||||||
my $nmonth = $month;
|
my $nmonth = $month;
|
||||||
my $nyear = $year;
|
my $nyear = $year;
|
||||||
while ((not exists $pagesources{"$archivebase/$nyear/" . sprintf("%02d", $nmonth)}) or ($nmonth == $month and $nyear == $year)) {
|
while ((not exists $pagesources{"$archivebase/$nyear/" . sprintf("%02d", $nmonth)}) or ($nmonth == $month and $nyear == $year)) {
|
||||||
|
|
Loading…
Reference in New Issue