aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@orbis-terrarum.net>2014-10-06 09:25:42 -0700
committerRobin H. Johnson <robbat2@orbis-terrarum.net>2014-10-06 09:25:42 -0700
commitcfa43fe21c342c5a7517edf0eae02a94404d4909 (patch)
tree5879d063f22533c17aba89114bc1305e23cd2161 /attachment.cgi
parentIgnore the master config. (diff)
parentMerge tag 'bugzilla-4.4.6' into upstream (diff)
downloadbugzilla-cfa43fe21c342c5a7517edf0eae02a94404d4909.tar.gz
bugzilla-cfa43fe21c342c5a7517edf0eae02a94404d4909.tar.bz2
bugzilla-cfa43fe21c342c5a7517edf0eae02a94404d4909.zip
Merge branch 'upstream', takes 4.4.6 fixesgentoo-4.4.6
Conflicts: .gitignore Bugzilla/Constants.pm docs/bugzilla.ent.tmpl template/en/default/pages/release-notes.html.tmpl
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi10
1 files changed, 6 insertions, 4 deletions
diff --git a/attachment.cgi b/attachment.cgi
index 18d783bf4..9b5d66122 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -205,8 +205,9 @@ sub validateContext
{
my $context = $cgi->param('context') || "patch";
if ($context ne "file" && $context ne "patch") {
- detaint_natural($context)
- || ThrowUserError("invalid_context", { context => $cgi->param('context') });
+ my $orig_context = $context;
+ detaint_natural($context)
+ || ThrowUserError("invalid_context", { context => $orig_context });
}
return $context;
@@ -524,13 +525,14 @@ sub insert {
# Get the filehandle of the attachment.
my $data_fh = $cgi->upload('data');
+ my $attach_text = $cgi->param('attach_text');
my $attachment = Bugzilla::Attachment->create(
{bug => $bug,
creation_ts => $timestamp,
- data => scalar $cgi->param('attach_text') || $data_fh,
+ data => $attach_text || $data_fh,
description => scalar $cgi->param('description'),
- filename => $cgi->param('attach_text') ? "file_$bugid.txt" : scalar $cgi->upload('data'),
+ filename => $attach_text ? "file_$bugid.txt" : $data_fh,
ispatch => scalar $cgi->param('ispatch'),
isprivate => scalar $cgi->param('isprivate'),
mimetype => $content_type,