projects
/
ikiwiki.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
7f64ff2
)
move meat of type checking to match_page where it belongs
author
Joey Hess
<joey@kitenet.net>
Thu, 6 May 2010 23:04:56 +0000
(19:04 -0400)
committer
Joey Hess
<joey@kitenet.net>
Thu, 6 May 2010 23:04:56 +0000
(19:04 -0400)
IkiWiki.pm
patch
|
blob
|
history
diff --git
a/IkiWiki.pm
b/IkiWiki.pm
index ee1ecb58f36003ec681f64fab13b5038fdfb43ad..43995fc9665a3768b88ec7919862e49972bcf1ca 100644
(file)
--- a/
IkiWiki.pm
+++ b/
IkiWiki.pm
@@
-2329,11
+2329,7
@@
sub match_glob ($$;@) {
my $regexp=IkiWiki::glob2re($glob);
if ($page=~/^$regexp$/i) {
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 {
return IkiWiki::SuccessReason->new("$glob matches $page");
}
else {
@@
-2350,7
+2346,14
@@
sub match_internal ($$;@) {
}
sub match_page ($$;@) {
}
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 ($$;@) {
}
sub match_link ($$;@) {