our $preprocess_preview=0;
sub preprocess ($$$;$$) { #{{{
my $page=shift; # the page the data comes from
our $preprocess_preview=0;
sub preprocess ($$$;$$) { #{{{
my $page=shift; # the page the data comes from
- # turn glob into safe regexp
- $glob=quotemeta($glob);
- $glob=~s/\\\*/.*/g;
- $glob=~s/\\\?/./g;
-
- if ($page=~/^$glob$/i) {
+ my $regexp=IkiWiki::glob2re($glob);
+ if ($page=~/^$regexp$/i) {
if (! IkiWiki::isinternal($page) || $params{internal}) {
return IkiWiki::SuccessReason->new("$glob matches $page");
}
if (! IkiWiki::isinternal($page) || $params{internal}) {
return IkiWiki::SuccessReason->new("$glob matches $page");
}