summaryrefslogtreecommitdiff
path: root/IkiWiki/Plugin
diff options
context:
space:
mode:
Diffstat (limited to 'IkiWiki/Plugin')
-rw-r--r--IkiWiki/Plugin/attachment.pm6
-rw-r--r--IkiWiki/Plugin/meta.pm4
2 files changed, 2 insertions, 8 deletions
diff --git a/IkiWiki/Plugin/attachment.pm b/IkiWiki/Plugin/attachment.pm
index 5d918c43f..1bcf5a2e4 100644
--- a/IkiWiki/Plugin/attachment.pm
+++ b/IkiWiki/Plugin/attachment.pm
@@ -318,11 +318,7 @@ sub match_mimetype ($$;@) { #{{{
$mimetype="unknown";
}
- # turn glob into a safe regexp
- my $regexp=quotemeta($wanted);
- $regexp=~s/\\\*/.*/g;
- $regexp=~s/\\\?/./g;
-
+ my $regexp=IkiWiki::glob2re($wanted);
if ($mimetype!~/^$regexp$/i) {
return IkiWiki::FailReason->new("file MIME type is $mimetype, not $wanted");
}
diff --git a/IkiWiki/Plugin/meta.pm b/IkiWiki/Plugin/meta.pm
index 8e1b11859..671060fbf 100644
--- a/IkiWiki/Plugin/meta.pm
+++ b/IkiWiki/Plugin/meta.pm
@@ -253,9 +253,7 @@ sub match { #{{{
my $page=shift;
# turn glob into a safe regexp
- my $re=quotemeta(shift);
- $re=~s/\\\*/.*/g;
- $re=~s/\\\?/./g;
+ my $re=IkiWiki::glob2re(shift);
my $val;
if (exists $pagestate{$page}{meta}{$field}) {