summaryrefslogtreecommitdiffstats
path: root/attachment.cgi
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2003-05-05 10:15:19 +0200
committerbbaetz%acm.org <>2003-05-05 10:15:19 +0200
commit9488a8906592564ec2e7601041f3ea5484cde3cc (patch)
treeb9308d1a3dcf639d1e561ede1186ff58afc01834 /attachment.cgi
parentc000c0a480f2cb73f2b0b89550bbd8e496b73c9d (diff)
downloadbugzilla-9488a8906592564ec2e7601041f3ea5484cde3cc.tar.gz
bugzilla-9488a8906592564ec2e7601041f3ea5484cde3cc.tar.xz
Bug 201816 - use CGI.pm for header output
r=joel, a=justdave
Diffstat (limited to 'attachment.cgi')
-rwxr-xr-xattachment.cgi27
1 files changed, 12 insertions, 15 deletions
diff --git a/attachment.cgi b/attachment.cgi
index 621477ed5..26892181f 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -33,7 +33,6 @@ use strict;
use lib qw(.);
use vars qw(
- $cgi
$template
$vars
);
@@ -63,6 +62,8 @@ quietly_check_login();
# to just above validateID().
my $bugid;
+my $cgi = Bugzilla->cgi;
+
################################################################################
# Main Body Execution
################################################################################
@@ -399,11 +400,12 @@ sub view
# Return the appropriate HTTP response headers.
$filename =~ s/^.*[\/\\]//;
my $filesize = length($thedata);
- print qq{Content-Type: $contenttype; name="$filename"\n};
- print qq{Content-Disposition: inline; filename=$filename\n};
- print qq{Content-Length: $filesize\n};
- print qq{\n$thedata};
+ print Bugzilla->cgi->header(-type=>"$contenttype; name=\"$filename\"",
+ -content_disposition=> "inline; filename=$filename\n",
+ -content_length => $filesize);
+
+ print $thedata;
}
@@ -450,8 +452,7 @@ sub viewall
$vars->{'bugsummary'} = $bugsummary;
$vars->{'GetBugLink'} = \&GetBugLink;
- # Return the appropriate HTTP response headers.
- print "Content-Type: text/html\n\n";
+ print Bugzilla->cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/show-multiple.html.tmpl", $vars)
@@ -495,8 +496,7 @@ sub enter
$vars->{'bugsummary'} = $bugsummary;
$vars->{'GetBugLink'} = \&GetBugLink;
- # Return the appropriate HTTP response headers.
- print "Content-Type: text/html\n\n";
+ print Bugzilla->cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/create.html.tmpl", $vars)
@@ -604,8 +604,7 @@ sub insert
$vars->{'contenttypemethod'} = $::FORM{'contenttypemethod'};
$vars->{'contenttype'} = $::FORM{'contenttype'};
- # Return the appropriate HTTP response headers.
- print "Content-Type: text/html\n\n";
+ print Bugzilla->cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/created.html.tmpl", $vars)
@@ -667,8 +666,7 @@ sub edit
$vars->{'attachments'} = \@bugattachments;
$vars->{'GetBugLink'} = \&GetBugLink;
- # Return the appropriate HTTP response headers.
- print "Content-Type: text/html\n\n";
+ print Bugzilla->cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/edit.html.tmpl", $vars)
@@ -815,8 +813,7 @@ sub update
$vars->{'attachid'} = $::FORM{'id'};
$vars->{'bugid'} = $bugid;
- # Return the appropriate HTTP response headers.
- print "Content-Type: text/html\n\n";
+ print Bugzilla->cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/updated.html.tmpl", $vars)