From 930fe68247cb3ec5aa304270818788b19600e9fb Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 11 Apr 2014 19:51:32 +0000 Subject: filter: clarify regular expression I often forget the subtleties of Perl regexps and newlines, so I suspect others do, too. Use explicit capture so it's more familiar to users of non-Perl regexps. --- lib/PublicInbox/Filter.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/PublicInbox/Filter.pm b/lib/PublicInbox/Filter.pm index e5a8fafe..bd33130c 100644 --- a/lib/PublicInbox/Filter.pm +++ b/lib/PublicInbox/Filter.pm @@ -93,7 +93,7 @@ sub dump_html { my $err = ""; # be careful about remote command injection! - if ($charset =~ /\A[A-Za-z0-9\-]+\z/) { + if ($charset =~ /\A([A-Za-z0-9\-]+)\z/) { push @cmd, "-assume_charset=$charset"; } if (IPC::Run::run(\@cmd, $body, \$out, \$err)) { -- cgit v1.2.3-24-ge0c7