diff options
author | David Lawrence <dkl@mozilla.com> | 2014-10-06 17:52:33 +0200 |
---|---|---|
committer | David Lawrence <dkl@mozilla.com> | 2014-10-06 17:52:33 +0200 |
commit | aafa79dbed67514aede45f884572c30934854107 (patch) | |
tree | def39520441fdc097877f222a32cc86e5e6fda40 /post_bug.cgi | |
parent | c034487bf62423265d0832197e0ff490f82330eb (diff) | |
parent | 3e1e67bed36bbe454c654f1e0a16ce73e724a5e0 (diff) | |
download | bugzilla-aafa79dbed67514aede45f884572c30934854107.tar.gz bugzilla-aafa79dbed67514aede45f884572c30934854107.tar.xz |
merged with upstream 4.2
Diffstat (limited to 'post_bug.cgi')
-rwxr-xr-x | post_bug.cgi | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/post_bug.cgi b/post_bug.cgi index 21b621acc..006fd40ee 100755 --- a/post_bug.cgi +++ b/post_bug.cgi @@ -187,7 +187,10 @@ if (defined $cgi->param('version')) { # after the bug is filed. # Add an attachment if requested. -if (defined($cgi->upload('data')) || $cgi->param('attach_text')) { +my $data_fh = $cgi->upload('data'); +my $attach_text = $cgi->param('attach_text'); + +if ($data_fh || $attach_text) { $cgi->param('isprivate', $cgi->param('comment_is_private')); # Must be called before create() as it may alter $cgi->param('ispatch'). @@ -202,9 +205,9 @@ if (defined($cgi->upload('data')) || $cgi->param('attach_text')) { $attachment = Bugzilla::Attachment->create( {bug => $bug, creation_ts => $timestamp, - data => scalar $cgi->param('attach_text') || $cgi->upload('data'), + data => $attach_text || $data_fh, description => scalar $cgi->param('description'), - filename => $cgi->param('attach_text') ? "file_$id.txt" : scalar $cgi->upload('data'), + filename => $attach_text ? "file_$id.txt" : $data_fh, ispatch => scalar $cgi->param('ispatch'), isprivate => scalar $cgi->param('isprivate'), mimetype => $content_type, |