summaryrefslogtreecommitdiffstats
path: root/Bugzilla/Attachment.pm
diff options
context:
space:
mode:
authorDavid Lawrence <dkl@mozilla.com>2014-10-06 17:52:33 +0200
committerDavid Lawrence <dkl@mozilla.com>2014-10-06 17:52:33 +0200
commitaafa79dbed67514aede45f884572c30934854107 (patch)
treedef39520441fdc097877f222a32cc86e5e6fda40 /Bugzilla/Attachment.pm
parentc034487bf62423265d0832197e0ff490f82330eb (diff)
parent3e1e67bed36bbe454c654f1e0a16ce73e724a5e0 (diff)
downloadbugzilla-aafa79dbed67514aede45f884572c30934854107.tar.gz
bugzilla-aafa79dbed67514aede45f884572c30934854107.tar.xz
merged with upstream 4.2
Diffstat (limited to 'Bugzilla/Attachment.pm')
-rw-r--r--Bugzilla/Attachment.pm13
1 files changed, 7 insertions, 6 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index c4c1b28aa..1302fc716 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -972,10 +972,12 @@ sub get_content_type {
return 'text/plain' if ($cgi->param('ispatch') || $cgi->param('attach_text'));
my $content_type;
- if (!defined $cgi->param('contenttypemethod')) {
+ my $method = $cgi->param('contenttypemethod');
+
+ if (!defined $method) {
ThrowUserError("missing_content_type_method");
}
- elsif ($cgi->param('contenttypemethod') eq 'autodetect') {
+ elsif ($method eq 'autodetect') {
defined $cgi->upload('data') || ThrowUserError('file_not_specified');
# The user asked us to auto-detect the content type, so use the type
# specified in the HTTP request headers.
@@ -996,18 +998,17 @@ sub get_content_type {
$content_type = 'image/png';
}
}
- elsif ($cgi->param('contenttypemethod') eq 'list') {
+ elsif ($method eq 'list') {
# The user selected a content type from the list, so use their
# selection.
$content_type = $cgi->param('contenttypeselection');
}
- elsif ($cgi->param('contenttypemethod') eq 'manual') {
+ elsif ($method eq 'manual') {
# The user entered a content type manually, so use their entry.
$content_type = $cgi->param('contenttypeentry');
}
else {
- ThrowCodeError("illegal_content_type_method",
- { contenttypemethod => $cgi->param('contenttypemethod') });
+ ThrowCodeError("illegal_content_type_method", { contenttypemethod => $method });
}
return $content_type;
}