]> git.vanrenterghem.biz Git - git.ikiwiki.info.git/blobdiff - IkiWiki/Plugin/filecheck.pm
update info on my split-view setup, and ask for plugin advice
[git.ikiwiki.info.git] / IkiWiki / Plugin / filecheck.pm
index a78058ffed7b15b46e1c1352c88ce70eebc4b00a..9992f2c2699371eb39ddb86776bba6c18c7a3562 100644 (file)
@@ -48,7 +48,6 @@ sub getsetup () {
                plugin => {
                        safe => 1,
                        rebuild => undef,
-                       section => "misc",
                },
 }
 
@@ -148,6 +147,7 @@ sub match_mimetype ($$;@) {
        if (! defined $mimetype) {
                open(my $file_h, "-|", "file", "-bi", $file);
                $mimetype=<$file_h>;
+               chomp $mimetype;
                close $file_h;
        }
        if (! defined $mimetype || $mimetype !~s /;.*//) {
@@ -160,7 +160,7 @@ sub match_mimetype ($$;@) {
        }
 
        my $regexp=IkiWiki::glob2re($wanted);
-       if ($mimetype!~/^$regexp$/i) {
+       if ($mimetype!~$regexp) {
                return IkiWiki::FailReason->new("file MIME type is $mimetype, not $wanted");
        }
        else {