+@@ -1784,12 +1883,16 @@ sub match_link ($$;@) { #{{{
+ return IkiWiki::FailReason->new("$page does not link to $link");
+ } #}}}
+
+-sub match_backlink ($$;@) { #{{{
+- return match_link($_[1], $_[0], @_);
++sub match_backlink ($$$;@) { #{{{
++ my $page=shift;
++ my $specFuncsRef=shift;
++ my $backlink=shift;
++ return match_link($backlink, $specFuncsRef, $page, @_);
+ } #}}}
+
+-sub match_created_before ($$;@) { #{{{
++sub match_created_before ($$$;@) { #{{{
+ my $page=shift;
++ my $specFuncsRef=shift;
+ my $testpage=shift;
+
+ if (exists $IkiWiki::pagectime{$testpage}) {
+@@ -1805,8 +1908,9 @@ sub match_created_before ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_created_after ($$;@) { #{{{
++sub match_created_after ($$$;@) { #{{{
+ my $page=shift;
++ my $specFuncsRef=shift;
+ my $testpage=shift;
+
+ if (exists $IkiWiki::pagectime{$testpage}) {
+@@ -1822,8 +1926,12 @@ sub match_created_after ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_creation_day ($$;@) { #{{{
+- if ((gmtime($IkiWiki::pagectime{shift()}))[3] == shift) {
++sub match_creation_day ($$$;@) { #{{{
++ my $page=shift;
++ shift;
++ my $time=shift;
++
++ if ((gmtime($IkiWiki::pagectime{$page}))[3] == $time) {
+ return IkiWiki::SuccessReason->new('creation_day matched');
+ }
+ else {
+@@ -1831,8 +1939,12 @@ sub match_creation_day ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_creation_month ($$;@) { #{{{
+- if ((gmtime($IkiWiki::pagectime{shift()}))[4] + 1 == shift) {
++sub match_creation_month ($$$;@) { #{{{
++ my $page=shift;
++ shift;
++ my $time=shift;
++
++ if ((gmtime($IkiWiki::pagectime{$page}))[4] + 1 == $time) {
+ return IkiWiki::SuccessReason->new('creation_month matched');
+ }
+ else {
+@@ -1840,8 +1952,12 @@ sub match_creation_month ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_creation_year ($$;@) { #{{{
+- if ((gmtime($IkiWiki::pagectime{shift()}))[5] + 1900 == shift) {
++sub match_creation_year ($$$;@) { #{{{
++ my $page=shift;
++ shift;
++ my $time=shift;
++
++ if ((gmtime($IkiWiki::pagectime{$page}))[5] + 1900 == $time) {
+ return IkiWiki::SuccessReason->new('creation_year matched');
+ }
+ else {
+diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
+index f1f792a..a410e48 100644
+--- a/IkiWiki/Plugin/attachment.pm
++++ b/IkiWiki/Plugin/attachment.pm
+@@ -291,7 +291,8 @@ sub attachment_list ($) { #{{{
+
+ package IkiWiki::PageSpec;
+
+-sub match_user ($$;@) { #{{{
++sub match_user ($$$;@) { #{{{
++ shift;
+ shift;
+ my $user=shift;
+ my %params=@_;
+@@ -311,7 +312,8 @@ sub match_user ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_ip ($$;@) { #{{{
++sub match_ip ($$$;@) { #{{{
++ shift;
+ shift;
+ my $ip=shift;
+ my %params=@_;
+diff --git a/IkiWiki/Plugin/conditional.pm b/IkiWiki/Plugin/conditional.pm
+index 7716fce..2110ca0 100644
+--- a/IkiWiki/Plugin/conditional.pm
++++ b/IkiWiki/Plugin/conditional.pm
+@@ -70,7 +70,8 @@ sub preprocess_if (@) { #{{{
+
+ package IkiWiki::PageSpec;
+
+-sub match_enabled ($$;@) { #{{{
++sub match_enabled ($$$;@) { #{{{
++ shift;
+ shift;
+ my $plugin=shift;
+
+@@ -83,13 +84,14 @@ sub match_enabled ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_sourcepage ($$;@) { #{{{
++sub match_sourcepage ($$$;@) { #{{{
+ shift;
++ my $specFuncsRef=shift;
+ my $glob=shift;
+ my %params=@_;
+
+ return IkiWiki::FailReason->new("cannot match sourcepage") unless exists $params{sourcepage};
+- if (match_glob($params{sourcepage}, $glob, @_)) {
++ if (match_glob($params{sourcepage}, $specFuncsRef, $glob, @_)) {
+ return IkiWiki::SuccessReason->new("sourcepage matches $glob");
+ }
+ else {
+@@ -97,13 +99,14 @@ sub match_sourcepage ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_destpage ($$;@) { #{{{
++sub match_destpage ($$$;@) { #{{{
+ shift;
++ my $specFuncsRef=shift;
+ my $glob=shift;
+ my %params=@_;
+
+ return IkiWiki::FailReason->new("cannot match destpage") unless exists $params{destpage};
+- if (match_glob($params{destpage}, $glob, @_)) {
++ if (match_glob($params{destpage}, $specFuncsRef, $glob, @_)) {
+ return IkiWiki::SuccessReason->new("destpage matches $glob");
+ }
+ else {
+@@ -111,7 +114,8 @@ sub match_destpage ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_included ($$;@) { #{{{
++sub match_included ($$$;@) { #{{{
++ shift;
+ shift;
+ shift;
+ my %params=@_;
+diff --git a/IkiWiki/Plugin/filecheck.pm b/IkiWiki/Plugin/filecheck.pm
+index 6f71be3..bf472c5 100644
+--- a/IkiWiki/Plugin/filecheck.pm
++++ b/IkiWiki/Plugin/filecheck.pm
+@@ -66,8 +66,9 @@ sub humansize ($) { #{{{
+
+ package IkiWiki::PageSpec;
+
+-sub match_maxsize ($$;@) { #{{{
++sub match_maxsize ($$$;@) { #{{{
+ my $page=shift;
++ shift;
+ my $maxsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
+ if ($@) {
+ return IkiWiki::FailReason->new("unable to parse maxsize (or number too large)");
+@@ -87,8 +88,9 @@ sub match_maxsize ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_minsize ($$;@) { #{{{
++sub match_minsize ($$$;@) { #{{{
+ my $page=shift;
++ shift;
+ my $minsize=eval{IkiWiki::Plugin::attachment::parsesize(shift)};
+ if ($@) {
+ return IkiWiki::FailReason->new("unable to parse minsize (or number too large)");
+@@ -108,8 +110,9 @@ sub match_minsize ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_mimetype ($$;@) { #{{{
++sub match_mimetype ($$$;@) { #{{{
+ my $page=shift;
++ shift;
+ my $wanted=shift;
+
+ my %params=@_;
+@@ -138,8 +141,9 @@ sub match_mimetype ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_virusfree ($$;@) { #{{{
++sub match_virusfree ($$$;@) { #{{{
+ my $page=shift;
++ shift;
+ my $wanted=shift;
+
+ my %params=@_;
+@@ -180,7 +184,7 @@ sub match_virusfree ($$;@) { #{{{
+ }
+ } #}}}
+
+-sub match_ispage ($$;@) { #{{{
++sub match_ispage ($$$;@) { #{{{
+ my $filename=shift;
+
+ if (defined IkiWiki::pagetype($filename)) {
+diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
+index b2c85c8..1ee6a69 100644
+--- a/IkiWiki/Plugin/meta.pm
++++ b/IkiWiki/Plugin/meta.pm
+@@ -264,6 +264,7 @@ sub pagetemplate (@) { #{{{
+ sub match { #{{{
+ my $field=shift;
+ my $page=shift;
++ shift;
+
+ # turn glob into a safe regexp
+ my $re=IkiWiki::glob2re(shift);
+@@ -291,23 +292,23 @@ sub match { #{{{
+
+ package IkiWiki::PageSpec;
+
+-sub match_title ($$;@) { #{{{
++sub match_title ($$$;@) { #{{{
+ IkiWiki::Plugin::meta::match("title", @_);
+ } #}}}
+
+-sub match_author ($$;@) { #{{{
++sub match_author ($$$;@) { #{{{
+ IkiWiki::Plugin::meta::match("author", @_);
+ } #}}}
+
+-sub match_authorurl ($$;@) { #{{{
++sub match_authorurl ($$$;@) { #{{{
+ IkiWiki::Plugin::meta::match("authorurl", @_);
+ } #}}}
+
+-sub match_license ($$;@) { #{{{
++sub match_license ($$$;@) { #{{{
+ IkiWiki::Plugin::meta::match("license", @_);
+ } #}}}
+
+-sub match_copyright ($$;@) { #{{{
++sub match_copyright ($$$;@) { #{{{
+ IkiWiki::Plugin::meta::match("copyright", @_);
+ } #}}}
+