Photos
Blog
Projects
vanrenterghem.biz
projects
/
git.ikiwiki.info.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added a comment
[git.ikiwiki.info.git]
/
IkiWiki
/
Plugin
/
filecheck.pm
diff --git
a/IkiWiki/Plugin/filecheck.pm
b/IkiWiki/Plugin/filecheck.pm
index a78058ffed7b15b46e1c1352c88ce70eebc4b00a..cdea5c706f4085686bf20b5e7a09283792137c31 100644
(file)
--- a/
IkiWiki/Plugin/filecheck.pm
+++ b/
IkiWiki/Plugin/filecheck.pm
@@
-48,7
+48,6
@@
sub getsetup () {
plugin => {
safe => 1,
rebuild => undef,
plugin => {
safe => 1,
rebuild => undef,
- section => "misc",
},
}
},
}
@@
-140,7
+139,7
@@
sub match_mimetype ($$;@) {
my $mimeinfo_ok=! $@;
my $mimetype;
if ($mimeinfo_ok) {
my $mimeinfo_ok=! $@;
my $mimetype;
if ($mimeinfo_ok) {
-
my
$mimetype=File::MimeInfo::Magic::magic($file);
+ $mimetype=File::MimeInfo::Magic::magic($file);
}
# Fall back to using file, which has a more complete
}
# Fall back to using file, which has a more complete
@@
-148,6
+147,7
@@
sub match_mimetype ($$;@) {
if (! defined $mimetype) {
open(my $file_h, "-|", "file", "-bi", $file);
$mimetype=<$file_h>;
if (! defined $mimetype) {
open(my $file_h, "-|", "file", "-bi", $file);
$mimetype=<$file_h>;
+ chomp $mimetype;
close $file_h;
}
if (! defined $mimetype || $mimetype !~s /;.*//) {
close $file_h;
}
if (! defined $mimetype || $mimetype !~s /;.*//) {
@@
-160,7
+160,7
@@
sub match_mimetype ($$;@) {
}
my $regexp=IkiWiki::glob2re($wanted);
}
my $regexp=IkiWiki::glob2re($wanted);
- if ($mimetype!~
/^$regexp$/i
) {
+ if ($mimetype!~
$regexp
) {
return IkiWiki::FailReason->new("file MIME type is $mimetype, not $wanted");
}
else {
return IkiWiki::FailReason->new("file MIME type is $mimetype, not $wanted");
}
else {