]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki.pm
This reverts commit 073bbe7ae00baa9ca89a61e43e53f072ac1b3b89
[git.ikiwiki.info.git] / IkiWiki.pm
index 2190f008c483bc4d0b715706b322de9a6b9317f6..08a3d7875da6b9941000b4531755fcb2a6f42d49 100644 (file)
@@ -2608,7 +2608,12 @@ sub match_created_after ($$;@) {
 }
 
 sub match_creation_day ($$;@) {
 }
 
 sub match_creation_day ($$;@) {
-       if ((localtime($IkiWiki::pagectime{shift()}))[3] == shift) {
+       my $page=shift;
+       my $d=shift;
+       if ($d !~ /^\d+$/) {
+               return IkiWiki::ErrorReason->new("invalid day $d");
+       }
+       if ((localtime($IkiWiki::pagectime{$page}))[3] == $d) {
                return IkiWiki::SuccessReason->new('creation_day matched');
        }
        else {
                return IkiWiki::SuccessReason->new('creation_day matched');
        }
        else {
@@ -2617,7 +2622,12 @@ sub match_creation_day ($$;@) {
 }
 
 sub match_creation_month ($$;@) {
 }
 
 sub match_creation_month ($$;@) {
-       if ((localtime($IkiWiki::pagectime{shift()}))[4] + 1 == shift) {
+       my $page=shift;
+       my $m=shift;
+       if ($m !~ /^\d+$/) {
+               return IkiWiki::ErrorReason->new("invalid month $m");
+       }
+       if ((localtime($IkiWiki::pagectime{$page}))[4] + 1 == $m) {
                return IkiWiki::SuccessReason->new('creation_month matched');
        }
        else {
                return IkiWiki::SuccessReason->new('creation_month matched');
        }
        else {
@@ -2626,7 +2636,12 @@ sub match_creation_month ($$;@) {
 }
 
 sub match_creation_year ($$;@) {
 }
 
 sub match_creation_year ($$;@) {
-       if ((localtime($IkiWiki::pagectime{shift()}))[5] + 1900 == shift) {
+       my $page=shift;
+       my $y=shift;
+       if ($y !~ /^\d+$/) {
+               return IkiWiki::ErrorReason->new("invalid year $y");
+       }
+       if ((localtime($IkiWiki::pagectime{$page}))[5] + 1900 == $y) {
                return IkiWiki::SuccessReason->new('creation_year matched');
        }
        else {
                return IkiWiki::SuccessReason->new('creation_year matched');
        }
        else {