From f3e29f40f397634b56c9d0035867db4696b06758 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Fr=C3=A9d=C3=A9ric=20Buclin?= Date: Fri, 22 Oct 2010 15:01:35 +0200 Subject: [PATCH] Bug 413648: Attachment mime type handling should strip leading and trailing spaces a=LpSolit --- Bugzilla/Attachment.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm index 0139922fad..a2abebb8d9 100644 --- a/Bugzilla/Attachment.pm +++ b/Bugzilla/Attachment.pm @@ -525,8 +525,9 @@ sub _check_content_type { my ($invocant, $content_type) = @_; $content_type = 'text/plain' if (ref $invocant && ($invocant->isurl || $invocant->ispatch)); + $content_type = trim($content_type); my $legal_types = join('|', LEGAL_CONTENT_TYPES); - if ($content_type !~ /^($legal_types)\/.+$/) { + if (!$content_type or $content_type !~ /^($legal_types)\/.+$/) { ThrowUserError("invalid_content_type", { contenttype => $content_type }); } trick_taint($content_type); -- 2.47.2