diff options
author | Frédéric Buclin <LpSolit@gmail.com> | 2011-04-28 16:47:16 +0200 |
---|---|---|
committer | Frédéric Buclin <LpSolit@gmail.com> | 2011-04-28 16:47:16 +0200 |
commit | 45cc062b9f6eca201c34b8257669d2b6d97da800 (patch) | |
tree | 4f65e7b1b2717e4b3ee0b359aecf505c39c12ea3 | |
parent | 7e87fb5db0c318644c892210eb4287b09280e014 (diff) | |
download | bugzilla-45cc062b9f6eca201c34b8257669d2b6d97da800.tar.gz bugzilla-45cc062b9f6eca201c34b8257669d2b6d97da800.tar.xz |
Bug 653404: Misleading error message when file to be attached is not readable by browser
r/a=LpSolit
-rwxr-xr-x | attachment.cgi | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/attachment.cgi b/attachment.cgi index 8ea802f44..f612815e2 100755 --- a/attachment.cgi +++ b/attachment.cgi @@ -487,10 +487,13 @@ sub insert { # Must be called before create() as it may alter $cgi->param('ispatch'). my $content_type = Bugzilla::Attachment::get_content_type(); + # Get the filehandle of the attachment. + my $data_fh = $cgi->upload('data'); + my $attachment = Bugzilla::Attachment->create( {bug => $bug, creation_ts => $timestamp, - data => scalar $cgi->param('attach_text') || $cgi->upload('data'), + data => scalar $cgi->param('attach_text') || $data_fh, description => scalar $cgi->param('description'), filename => $cgi->param('attach_text') ? "file_$bugid.txt" : scalar $cgi->upload('data'), ispatch => scalar $cgi->param('ispatch'), |