From 8c7110d4c857a51e02dc255000db796ecfdae9ab Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Wed, 8 Oct 2014 18:41:02 +0400 Subject: [PATCH] sidebar.cgi: code style, remove CGI usage --- sidebar.cgi | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/sidebar.cgi b/sidebar.cgi index 5e9f7909c..fd6ff30e5 100755 --- a/sidebar.cgi +++ b/sidebar.cgi @@ -1,6 +1,4 @@ #!/usr/bin/perl -wT -# -*- Mode: perl; indent-tabs-mode: nil -*- -# # The contents of this file are subject to the Mozilla Public # License Version 1.1 (the "License"); you may not use this file # except in compliance with the License. You may obtain a copy of @@ -23,7 +21,6 @@ use Bugzilla; use Bugzilla::Error; Bugzilla->login(); -my $cgi = Bugzilla->cgi; my $template = Bugzilla->template; ############################################################################### @@ -39,11 +36,15 @@ my $template = Bugzilla->template; # http://bugzilla.mozilla.org/show_bug.cgi?id=37339 my $useragent = $ENV{HTTP_USER_AGENT}; -if ($useragent =~ m:Mozilla/([1-9][0-9]*):i && $1 >= 5 && $useragent !~ m/compatible/i) { - $cgi->send_header("application/vnd.mozilla.xul+xml"); +if ($useragent =~ m:Mozilla/([1-9][0-9]*):i && $1 >= 5 && $useragent !~ m/compatible/i) +{ + Bugzilla->cgi->send_header("application/vnd.mozilla.xul+xml"); # Generate and return the XUL from the appropriate template. $template->process("sidebar.xul.tmpl") - || ThrowTemplateError($template->error()); -} else { + || ThrowTemplateError($template->error()); +} +else +{ ThrowUserError("sidebar_supports_mozilla_only"); } +exit;