summaryrefslogtreecommitdiffstats
path: root/showattachment.cgi
diff options
context:
space:
mode:
Diffstat (limited to 'showattachment.cgi')
-rwxr-xr-xshowattachment.cgi18
1 files changed, 11 insertions, 7 deletions
diff --git a/showattachment.cgi b/showattachment.cgi
index bfe9ef988..82fc1ba9a 100755
--- a/showattachment.cgi
+++ b/showattachment.cgi
@@ -25,12 +25,16 @@ use strict;
use lib qw(.);
-require "CGI.pl";
+use Bugzilla;
+use Bugzilla::Util;
+
+my $cgi = Bugzilla->cgi;
+
+my $id = $cgi->param('attach_id');
+detaint_natural($id) if defined $id;
+$id ||= "";
+
+print $cgi->redirect(-location=>"attachment.cgi?id=$id&action=view",
+ -status=>'301 Permanent Redirect');
-# Redirect to the new interface for displaying attachments.
-detaint_natural($::FORM{'attach_id'}) if defined($::FORM{'attach_id'});
-my $id = $::FORM{'attach_id'} || "";
-print "Status: 301 Permanent Redirect\n";
-print "Location: attachment.cgi?id=$id&action=view\n\n";
exit;
-