From 965f66d87a03792c13fd0fd6e4e38c9458753748 Mon Sep 17 00:00:00 2001 From: Simon McVittie Date: Fri, 6 May 2016 07:32:17 +0100 Subject: [PATCH] img: make img_allowed_formats case-insensitive --- IkiWiki/Plugin/img.pm | 2 +- t/img.t | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/IkiWiki/Plugin/img.pm b/IkiWiki/Plugin/img.pm index 494fe2335..c3dc41474 100644 --- a/IkiWiki/Plugin/img.pm +++ b/IkiWiki/Plugin/img.pm @@ -39,7 +39,7 @@ sub allowed { $allowed = ['jpeg', 'png', 'gif', 'svg'] unless defined $allowed && @$allowed; foreach my $a (@$allowed) { - return 1 if $a eq $format || $a eq 'everything'; + return 1 if lc($a) eq $format || lc($a) eq 'everything'; } return 0; diff --git a/t/img.t b/t/img.t index 401858a13..537a23d1c 100755 --- a/t/img.t +++ b/t/img.t @@ -97,7 +97,7 @@ EOF ); ok(utime(333333333, 333333333, "t/tmp/in/imgconversions.mdwn")); -ok(! system(@command, '--set-yaml', 'img_allowed_formats=[jpeg, png, svg, pdf]')); +ok(! system(@command, '--set-yaml', 'img_allowed_formats=[JPEG, PNG, svg, pdf]')); sub size($) { my $filename = shift; -- 2.39.5