move meat of type checking to match_page where it belongs
parent
7f64ff2ae0
commit
71b8d2ad41
15
IkiWiki.pm
15
IkiWiki.pm
|
@ -2329,11 +2329,7 @@ sub match_glob ($$;@) {
|
|||
|
||||
my $regexp=IkiWiki::glob2re($glob);
|
||||
if ($page=~/^$regexp$/i) {
|
||||
if ($params{onlypage} &&
|
||||
! defined IkiWiki::pagetype($IkiWiki::pagesources{$page})) {
|
||||
return IkiWiki::FailReason->new("$page is not a page");
|
||||
}
|
||||
elsif (! IkiWiki::isinternal($page) || $params{internal}) {
|
||||
if (! IkiWiki::isinternal($page) || $params{internal}) {
|
||||
return IkiWiki::SuccessReason->new("$glob matches $page");
|
||||
}
|
||||
else {
|
||||
|
@ -2350,7 +2346,14 @@ sub match_internal ($$;@) {
|
|||
}
|
||||
|
||||
sub match_page ($$;@) {
|
||||
return match_glob($_[0], $_[1], @_, onlypage => 1)
|
||||
my $page=shift;
|
||||
my $match=match_glob($page, $_[1], @_);
|
||||
if ($match && ! defined IkiWiki::pagetype($IkiWiki::pagesources{$page})) {
|
||||
return IkiWiki::FailReason->new("$page is not a page");
|
||||
}
|
||||
else {
|
||||
return $match;
|
||||
}
|
||||
}
|
||||
|
||||
sub match_link ($$;@) {
|
||||
|
|
Loading…
Reference in New Issue