summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Bugzilla/Attachment.pm4
-rw-r--r--Bugzilla/Flag.pm5
-rw-r--r--Bugzilla/FlagType.pm3
-rw-r--r--Bugzilla/Search.pm2
-rw-r--r--Bugzilla/Token.pm4
-rw-r--r--CGI.pl67
-rwxr-xr-xattachment.cgi26
-rwxr-xr-xbuglist.cgi23
-rwxr-xr-xchart.cgi9
-rwxr-xr-xcolchange.cgi5
-rwxr-xr-xconfig.cgi2
-rw-r--r--contrib/sendunsentbugmail.pl2
-rwxr-xr-xcontrib/syncLDAP.pl2
-rwxr-xr-xcreateaccount.cgi2
-rwxr-xr-xdescribecomponents.cgi2
-rwxr-xr-xdescribekeywords.cgi2
-rwxr-xr-xdoeditparams.cgi2
-rwxr-xr-xduplicates.cgi1
-rwxr-xr-xeditcomponents.cgi2
-rwxr-xr-xeditflagtypes.cgi2
-rwxr-xr-xeditgroups.cgi2
-rwxr-xr-xeditkeywords.cgi2
-rwxr-xr-xeditmilestones.cgi1
-rwxr-xr-xeditparams.cgi2
-rwxr-xr-xeditproducts.cgi1
-rwxr-xr-xeditsettings.cgi2
-rwxr-xr-xeditusers.cgi1
-rwxr-xr-xeditversions.cgi1
-rwxr-xr-xeditwhines.cgi1
-rwxr-xr-xenter_bug.cgi2
-rw-r--r--globals.pl1
-rwxr-xr-ximportxml.pl1
-rwxr-xr-xindex.cgi6
-rwxr-xr-xlong_list.cgi5
-rwxr-xr-xmove.pl2
-rwxr-xr-xpage.cgi2
-rwxr-xr-xpost_bug.cgi7
-rwxr-xr-xprocess_bug.cgi2
-rwxr-xr-xquery.cgi8
-rwxr-xr-xquips.cgi8
-rwxr-xr-xrelogin.cgi8
-rwxr-xr-xreport.cgi9
-rwxr-xr-xreports.cgi2
-rwxr-xr-xrequest.cgi2
-rwxr-xr-xsanitycheck.cgi2
-rwxr-xr-xshow_activity.cgi4
-rwxr-xr-xshow_bug.cgi2
-rwxr-xr-xshowdependencygraph.cgi2
-rwxr-xr-xshowdependencytree.cgi2
-rwxr-xr-xsidebar.cgi7
-rwxr-xr-xsummarize_time.cgi2
-rw-r--r--template/en/default/global/help-header.html.tmpl2
-rw-r--r--template/en/default/global/help.html.tmpl2
-rw-r--r--template/en/default/search/search-advanced.html.tmpl4
-rwxr-xr-xtoken.cgi2
-rwxr-xr-xuserprefs.cgi2
-rwxr-xr-xvotes.cgi2
-rwxr-xr-xxml.cgi5
58 files changed, 97 insertions, 188 deletions
diff --git a/Bugzilla/Attachment.pm b/Bugzilla/Attachment.pm
index 10fa6ddfc..78f4ceed5 100644
--- a/Bugzilla/Attachment.pm
+++ b/Bugzilla/Attachment.pm
@@ -28,8 +28,8 @@ use strict;
package Bugzilla::Attachment;
-# This module requires that its caller have said "require CGI.pl" to import
-# relevant functions from that script and its companion globals.pl.
+# This module requires that its caller have said "require globals.pl" to import
+# relevant functions from that script.
# Use the Flag module to handle flags.
use Bugzilla::Flag;
diff --git a/Bugzilla/Flag.pm b/Bugzilla/Flag.pm
index 65636d78c..6c5adf440 100644
--- a/Bugzilla/Flag.pm
+++ b/Bugzilla/Flag.pm
@@ -37,12 +37,11 @@ See below for more information.
=item *
Prior to calling routines in this module, it's assumed that you have
-already done a C<require CGI.pl>. This will eventually change in a
-future version when CGI.pl is removed.
+already done a C<require globals.pl>.
=item *
-Import relevant functions from that script and its companion globals.pl.
+Import relevant functions from that script.
=item *
diff --git a/Bugzilla/FlagType.pm b/Bugzilla/FlagType.pm
index 49c9f777e..678721b5f 100644
--- a/Bugzilla/FlagType.pm
+++ b/Bugzilla/FlagType.pm
@@ -35,8 +35,7 @@ See below for more information.
=item *
Prior to calling routines in this module, it's assumed that you have
-already done a C<require CGI.pl>. This will eventually change in a
-future version when CGI.pl is removed.
+already done a C<require globals.pl>.
=item *
diff --git a/Bugzilla/Search.pm b/Bugzilla/Search.pm
index 31dbcd2ab..0b1ac94ba 100644
--- a/Bugzilla/Search.pm
+++ b/Bugzilla/Search.pm
@@ -29,7 +29,7 @@
use strict;
-# The caller MUST require CGI.pl and globals.pl before using this
+# The caller MUST require globals.pl before using this module.
use vars qw($userid);
diff --git a/Bugzilla/Token.pm b/Bugzilla/Token.pm
index fe72915a3..44ee1a642 100644
--- a/Bugzilla/Token.pm
+++ b/Bugzilla/Token.pm
@@ -37,8 +37,8 @@ use Bugzilla::Util;
use Date::Format;
use Date::Parse;
-# This module requires that its caller have said "require CGI.pl" to import
-# relevant functions from that script and its companion globals.pl.
+# This module requires that its caller have said "require globals.pl" to import
+# relevant functions from that script.
################################################################################
# Constants
diff --git a/CGI.pl b/CGI.pl
deleted file mode 100644
index c1b8aca11..000000000
--- a/CGI.pl
+++ /dev/null
@@ -1,67 +0,0 @@
-# -*- 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
-# the License at http://www.mozilla.org/MPL/
-#
-# Software distributed under the License is distributed on an "AS
-# IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
-# implied. See the License for the specific language governing
-# rights and limitations under the License.
-#
-# The Original Code is the Bugzilla Bug Tracking System.
-#
-# The Initial Developer of the Original Code is Netscape Communications
-# Corporation. Portions created by Netscape are
-# Copyright (C) 1998 Netscape Communications Corporation. All
-# Rights Reserved.
-#
-# Contributor(s): Terry Weissman <terry@mozilla.org>
-# Dan Mosedale <dmose@mozilla.org>
-# Joe Robins <jmrobins@tgix.com>
-# Dave Miller <justdave@syndicomm.com>
-# Christopher Aillon <christopher@aillon.com>
-# Gervase Markham <gerv@gerv.net>
-# Christian Reis <kiko@async.com.br>
-
-# Contains some global routines used throughout the CGI scripts of Bugzilla.
-
-use strict;
-use lib ".";
-
-# use Carp; # for confess
-
-use Bugzilla::Util;
-use Bugzilla::Config;
-use Bugzilla::Constants;
-use Bugzilla::Error;
-use Bugzilla::BugMail;
-use Bugzilla::Bug;
-use Bugzilla::User;
-
-# Shut up misguided -w warnings about "used only once". For some reason,
-# "use vars" chokes on me when I try it here.
-
-sub CGI_pl_sillyness {
- my $zz;
- $zz = $::buffer;
-}
-
-require 'globals.pl';
-
-use vars qw($vars);
-
-############# Live code below here (that is, not subroutine defs) #############
-
-use Bugzilla;
-
-# XXX - mod_perl - reset this between runs
-$::cgi = Bugzilla->cgi;
-
-$::buffer = $::cgi->query_string();
-
-# This could be needed in any CGI, so we set it here.
-$vars->{'help'} = $::cgi->param('help') ? 1 : 0;
-
-1;
diff --git a/attachment.cgi b/attachment.cgi
index 1ed7a2322..ea04e2c19 100755
--- a/attachment.cgi
+++ b/attachment.cgi
@@ -35,13 +35,10 @@ use strict;
use lib qw(.);
-use vars qw(
- $template
- $vars
-);
+use vars qw($template $vars);
# Include the Bugzilla CGI and general utility library.
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Config qw(:locations);
# Use these modules to handle flags.
@@ -135,7 +132,7 @@ sub validateID
# Happens when calling plain attachment.cgi from the urlbar directly
if ($param eq 'id' && !$cgi->param('id')) {
- print Bugzilla->cgi->header();
+ print $cgi->header();
$template->process("attachment/choose.html.tmpl", $vars) ||
ThrowTemplateError($template->error());
exit;
@@ -512,9 +509,9 @@ sub view
$filename =~ s/\\/\\\\/g; # escape backslashes
$filename =~ s/"/\\"/g; # escape quotes
- print Bugzilla->cgi->header(-type=>"$contenttype; name=\"$filename\"",
- -content_disposition=> "inline; filename=\"$filename\"",
- -content_length => $filesize);
+ print $cgi->header(-type=>"$contenttype; name=\"$filename\"",
+ -content_disposition=> "inline; filename=\"$filename\"",
+ -content_length => $filesize);
if ($thedata) {
print $thedata;
@@ -746,7 +743,6 @@ sub diff
require PatchReader::DiffPrinter::raw;
$last_reader->sends_data_to(new PatchReader::DiffPrinter::raw());
# Actually print out the patch
- use vars qw($cgi);
print $cgi->header(-type => 'text/plain',
-expires => '+3M');
$reader->iterate_string("Attachment $attach_id", $thedata);
@@ -830,7 +826,7 @@ sub viewall
$vars->{'bugsummary'} = $bugsummary;
$vars->{'GetBugLink'} = \&GetBugLink;
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/show-multiple.html.tmpl", $vars)
@@ -887,7 +883,7 @@ sub enter
$vars->{'any_flags_requesteeble'} = grep($_->{'is_requesteeble'},
@$flag_types);
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/create.html.tmpl", $vars)
@@ -1070,7 +1066,7 @@ sub insert
$vars->{'contenttypemethod'} = $cgi->param('contenttypemethod');
$vars->{'contenttype'} = $cgi->param('contenttype');
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/created.html.tmpl", $vars)
@@ -1135,7 +1131,7 @@ sub edit
require PatchReader;
$vars->{'patchviewerinstalled'} = 1;
};
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/edit.html.tmpl", $vars)
@@ -1290,7 +1286,7 @@ sub update
$vars->{'attachid'} = $attach_id;
$vars->{'bugid'} = $bugid;
- print Bugzilla->cgi->header();
+ print $cgi->header();
# Generate and return the UI (HTML page) from the appropriate template.
$template->process("attachment/updated.html.tmpl", $vars)
diff --git a/buglist.cgi b/buglist.cgi
index 45c0db552..6bc3af291 100755
--- a/buglist.cgi
+++ b/buglist.cgi
@@ -42,7 +42,7 @@ use Bugzilla::Constants;
use Bugzilla::User;
# Include the Bugzilla CGI and general utility library.
-require "CGI.pl";
+require "globals.pl";
use vars qw($db_name
@components
@@ -58,8 +58,9 @@ use vars qw($db_name
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $buffer = $cgi->query_string();
-if (length($::buffer) == 0) {
+if (length($buffer) == 0) {
print $cgi->header(-refresh=> '10; URL=query.cgi');
ThrowUserError("buglist_parameters_required");
}
@@ -146,8 +147,8 @@ if (defined $cgi->param('regetlastlist')) {
});
}
-if ($::buffer =~ /&cmd-/) {
- my $url = "query.cgi?$::buffer#chart";
+if ($buffer =~ /&cmd-/) {
+ my $url = "query.cgi?$buffer#chart";
print $cgi->redirect(-location => $url);
# Generate and return the UI (HTML page) from the appropriate template.
$vars->{'message'} = "buglist_adding_field";
@@ -361,18 +362,18 @@ if ($cgi->param('cmdtype') eq "dorem" && $cgi->param('remaction') =~ /^run/) {
# Take appropriate action based on user's request.
if ($cgi->param('cmdtype') eq "dorem") {
if ($cgi->param('remaction') eq "run") {
- $::buffer = LookupNamedQuery(scalar $cgi->param("namedcmd"));
+ $buffer = LookupNamedQuery(scalar $cgi->param("namedcmd"));
$vars->{'searchname'} = $cgi->param('namedcmd');
$vars->{'searchtype'} = "saved";
- $params = new Bugzilla::CGI($::buffer);
+ $params = new Bugzilla::CGI($buffer);
$order = $params->param('order') || $order;
}
elsif ($cgi->param('remaction') eq "runseries") {
- $::buffer = LookupSeries(scalar $cgi->param("series_id"));
+ $buffer = LookupSeries(scalar $cgi->param("series_id"));
$vars->{'searchname'} = $cgi->param('namedcmd');
$vars->{'searchtype'} = "series";
- $params = new Bugzilla::CGI($::buffer);
+ $params = new Bugzilla::CGI($buffer);
$order = $params->param('order') || $order;
}
elsif ($cgi->param('remaction') eq "forget") {
@@ -402,7 +403,7 @@ if ($cgi->param('cmdtype') eq "dorem") {
elsif (($cgi->param('cmdtype') eq "doit") && defined $cgi->param('remtype')) {
if ($cgi->param('remtype') eq "asdefault") {
Bugzilla->login(LOGIN_REQUIRED);
- InsertNamedQuery(Bugzilla->user->id, DEFAULT_QUERY_NAME, $::buffer);
+ InsertNamedQuery(Bugzilla->user->id, DEFAULT_QUERY_NAME, $buffer);
$vars->{'message'} = "buglist_new_default_query";
}
elsif ($cgi->param('remtype') eq "asnamed") {
@@ -439,7 +440,7 @@ elsif (($cgi->param('cmdtype') eq "doit") && defined $cgi->param('remtype')) {
# form - see bug 252295
if (!$params->param('query_format')) {
$params->param('query_format', 'advanced');
- $::buffer = $params->query_string;
+ $buffer = $params->query_string;
}
################################################################################
@@ -937,7 +938,7 @@ $vars->{'closedstates'} = ['CLOSED', 'VERIFIED', 'RESOLVED'];
# buffer that was created when we initially parsed the URL on script startup,
# then we remove all non-query fields from it, f.e. the sort order (order)
# and command type (cmdtype) fields.
-$vars->{'urlquerypart'} = $::buffer;
+$vars->{'urlquerypart'} = $buffer;
$vars->{'urlquerypart'} =~ s/(order|cmdtype)=[^&]*&?//g;
$vars->{'order'} = $order;
diff --git a/chart.cgi b/chart.cgi
index bc25d52e9..31f961cac 100755
--- a/chart.cgi
+++ b/chart.cgi
@@ -44,13 +44,17 @@
use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
+use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Chart;
use Bugzilla::Series;
use Bugzilla::User;
-use vars qw($cgi $template $vars);
+use vars qw($vars);
+
+my $cgi = Bugzilla->cgi;
+my $template = Bugzilla->template;
# Go back to query.cgi if we are adding a boolean chart parameter.
if (grep(/^cmd-/, $cgi->param())) {
@@ -60,7 +64,6 @@ if (grep(/^cmd-/, $cgi->param())) {
exit;
}
-my $template = Bugzilla->template;
my $action = $cgi->param('action');
my $series_id = $cgi->param('series_id');
diff --git a/colchange.cgi b/colchange.cgi
index 30103406f..e99b81b70 100755
--- a/colchange.cgi
+++ b/colchange.cgi
@@ -27,7 +27,6 @@ use lib qw(.);
use vars qw(
@legal_keywords
- $buffer
$template
$vars
);
@@ -35,7 +34,7 @@ use vars qw(
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login();
@@ -150,7 +149,7 @@ if (defined $cgi->cookie('COLUMNLIST')) {
$vars->{'collist'} = \@collist;
$vars->{'splitheader'} = $cgi->cookie('SPLITHEADER') ? 1 : 0;
-$vars->{'buffer'} = $::buffer;
+$vars->{'buffer'} = $cgi->query_string();
# Generate and return the UI (HTML page) from the appropriate template.
print $cgi->header();
diff --git a/config.cgi b/config.cgi
index 1306c0b66..bbffe20d8 100755
--- a/config.cgi
+++ b/config.cgi
@@ -31,7 +31,7 @@ use strict;
# Include the Bugzilla CGI and general utility library.
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
# Retrieve this installation's configuration.
GetVersionTable();
diff --git a/contrib/sendunsentbugmail.pl b/contrib/sendunsentbugmail.pl
index c82c0ae30..9453a6538 100644
--- a/contrib/sendunsentbugmail.pl
+++ b/contrib/sendunsentbugmail.pl
@@ -25,7 +25,7 @@ use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::BugMail;
diff --git a/contrib/syncLDAP.pl b/contrib/syncLDAP.pl
index 14ba1402c..6e78854e0 100755
--- a/contrib/syncLDAP.pl
+++ b/contrib/syncLDAP.pl
@@ -23,7 +23,7 @@
use strict;
-require "CGI.pl";
+require "globals.pl";
use lib qw(.);
diff --git a/createaccount.cgi b/createaccount.cgi
index 337f89d0a..29b3c00ec 100755
--- a/createaccount.cgi
+++ b/createaccount.cgi
@@ -28,7 +28,7 @@ use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
diff --git a/describecomponents.cgi b/describecomponents.cgi
index 8e1755498..9602c0fe0 100755
--- a/describecomponents.cgi
+++ b/describecomponents.cgi
@@ -26,7 +26,7 @@ use lib qw(.);
use Bugzilla;
use Bugzilla::Constants;
-require "CGI.pl";
+require "globals.pl";
use vars qw($vars @legal_product);
diff --git a/describekeywords.cgi b/describekeywords.cgi
index e7b3b759b..ab88c2f15 100755
--- a/describekeywords.cgi
+++ b/describekeywords.cgi
@@ -27,7 +27,7 @@ use lib ".";
use Bugzilla;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
# Use the global template variables.
use vars qw($vars $template);
diff --git a/doeditparams.cgi b/doeditparams.cgi
index 431aa91c2..cfc21e23d 100755
--- a/doeditparams.cgi
+++ b/doeditparams.cgi
@@ -30,7 +30,7 @@ use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT :admin $datadir);
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login(LOGIN_REQUIRED);
diff --git a/duplicates.cgi b/duplicates.cgi
index 744ad8147..92c697f53 100755
--- a/duplicates.cgi
+++ b/duplicates.cgi
@@ -30,7 +30,6 @@ use AnyDBM_File;
use lib qw(.);
require "globals.pl";
-require "CGI.pl";
use Bugzilla;
use Bugzilla::Search;
diff --git a/editcomponents.cgi b/editcomponents.cgi
index 6f8bc99f2..c25f971fc 100755
--- a/editcomponents.cgi
+++ b/editcomponents.cgi
@@ -28,7 +28,6 @@
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use Bugzilla::Constants;
@@ -36,6 +35,7 @@ use Bugzilla::Config qw(:DEFAULT $datadir);
use Bugzilla::Series;
use Bugzilla::Util;
use Bugzilla::User;
+use Bugzilla::Bug;
use vars qw($template $vars);
diff --git a/editflagtypes.cgi b/editflagtypes.cgi
index 57795f493..ec449a87d 100755
--- a/editflagtypes.cgi
+++ b/editflagtypes.cgi
@@ -29,7 +29,7 @@ use strict;
use lib ".";
# Include the Bugzilla CGI and general utility library.
-require "CGI.pl";
+require "globals.pl";
# Use Bugzilla's flag modules for handling flag types.
use Bugzilla;
diff --git a/editgroups.cgi b/editgroups.cgi
index 5e74163da..e41dc7d07 100755
--- a/editgroups.cgi
+++ b/editgroups.cgi
@@ -32,7 +32,7 @@ use lib ".";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
diff --git a/editkeywords.cgi b/editkeywords.cgi
index 8ad74710e..3062e3ded 100755
--- a/editkeywords.cgi
+++ b/editkeywords.cgi
@@ -23,7 +23,7 @@
use strict;
use lib ".";
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT $datadir);
diff --git a/editmilestones.cgi b/editmilestones.cgi
index 4fbcab046..fa1117ede 100755
--- a/editmilestones.cgi
+++ b/editmilestones.cgi
@@ -19,7 +19,6 @@
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use Bugzilla::Constants;
diff --git a/editparams.cgi b/editparams.cgi
index 668a13801..264e991a4 100755
--- a/editparams.cgi
+++ b/editparams.cgi
@@ -29,7 +29,7 @@ use Bugzilla::Constants;
use Bugzilla::Config qw(:DEFAULT :admin);
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login(LOGIN_REQUIRED);
diff --git a/editproducts.cgi b/editproducts.cgi
index 18e845efc..cacf8eef8 100755
--- a/editproducts.cgi
+++ b/editproducts.cgi
@@ -33,7 +33,6 @@ use strict;
use lib ".";
use vars qw ($template $vars);
use Bugzilla::Constants;
-require "CGI.pl";
require "globals.pl";
use Bugzilla::Bug;
use Bugzilla::Series;
diff --git a/editsettings.cgi b/editsettings.cgi
index 80a8921d5..742bd7176 100755
--- a/editsettings.cgi
+++ b/editsettings.cgi
@@ -24,7 +24,7 @@ use Bugzilla::Constants;
use Bugzilla::User;
use Bugzilla::User::Setting;
-require "CGI.pl";
+require "globals.pl";
# Use global template variables.
use vars qw($template $vars);
diff --git a/editusers.cgi b/editusers.cgi
index 9da66424d..f628752cd 100755
--- a/editusers.cgi
+++ b/editusers.cgi
@@ -18,7 +18,6 @@
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use vars qw( $vars );
diff --git a/editversions.cgi b/editversions.cgi
index a7ced7df3..cf2303e5f 100755
--- a/editversions.cgi
+++ b/editversions.cgi
@@ -31,7 +31,6 @@
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use Bugzilla::Constants;
diff --git a/editwhines.cgi b/editwhines.cgi
index 1f5c954f3..66387dd82 100755
--- a/editwhines.cgi
+++ b/editwhines.cgi
@@ -28,7 +28,6 @@
use strict;
use lib ".";
-require "CGI.pl";
require "globals.pl";
use vars qw( $vars );
diff --git a/enter_bug.cgi b/enter_bug.cgi
index f3437b7ed..1d85761b4 100755
--- a/enter_bug.cgi
+++ b/enter_bug.cgi
@@ -41,7 +41,7 @@ use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Bug;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
use vars qw(
$template
diff --git a/globals.pl b/globals.pl
index f8f070366..d4ba17004 100644
--- a/globals.pl
+++ b/globals.pl
@@ -37,6 +37,7 @@ use Bugzilla::Util;
use Bugzilla::Config qw(:DEFAULT ChmodDataFile $localconfig $datadir);
use Bugzilla::BugMail;
use Bugzilla::User;
+use Bugzilla::Error;
# Shut up misguided -w warnings about "used only once". For some reason,
# "use vars" chokes on me when I try it here.
diff --git a/importxml.pl b/importxml.pl
index 0d9dcb868..9c56b3d1a 100755
--- a/importxml.pl
+++ b/importxml.pl
@@ -69,7 +69,6 @@ $Data::Dumper::Useqq = 1;
use Bugzilla::BugMail;
use Bugzilla::User;
-require "CGI.pl";
require "globals.pl";
GetVersionTable();
diff --git a/index.cgi b/index.cgi
index 88393b417..bc3a1272f 100755
--- a/index.cgi
+++ b/index.cgi
@@ -30,11 +30,9 @@ use strict;
# Include the Bugzilla CGI and general utility library.
use lib ".";
-require "CGI.pl";
+require "globals.pl";
-use vars qw(
- $vars
-);
+use vars qw($vars);
# Check whether or not the user is logged in and, if so, set the $::userid
use Bugzilla::Constants;
diff --git a/long_list.cgi b/long_list.cgi
index 04758729d..a5d59909b 100755
--- a/long_list.cgi
+++ b/long_list.cgi
@@ -23,10 +23,9 @@
use strict;
use lib qw(.);
+use Bugzilla;
-require "CGI.pl";
-
-our $cgi;
+my $cgi = Bugzilla->cgi;
# Convert comma/space separated elements into separate params
my @ids = ();
diff --git a/move.pl b/move.pl
index 92a051b63..82c40034d 100755
--- a/move.pl
+++ b/move.pl
@@ -26,7 +26,7 @@ use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use vars qw($template $userid);
diff --git a/page.cgi b/page.cgi
index 6e78317fc..9954c64a8 100755
--- a/page.cgi
+++ b/page.cgi
@@ -34,7 +34,7 @@ use lib ".";
use Bugzilla;
-require "CGI.pl";
+require "globals.pl";
use vars qw($template $vars);
diff --git a/post_bug.cgi b/post_bug.cgi
index 01c0e1845..0c421b638 100755
--- a/post_bug.cgi
+++ b/post_bug.cgi
@@ -26,7 +26,7 @@
use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Bug;
@@ -37,7 +37,6 @@ use Bugzilla::Field;
# "use vars" chokes on me when I try it here.
sub sillyness {
my $zz;
- $zz = $::buffer;
$zz = %::components;
$zz = %::versions;
$zz = @::legal_opsys;
@@ -52,9 +51,7 @@ sub sillyness {
use vars qw($vars $template);
my $user = Bugzilla->login(LOGIN_REQUIRED);
-
my $cgi = Bugzilla->cgi;
-
my $dbh = Bugzilla->dbh;
# do a match on the fields if applicable
@@ -94,7 +91,7 @@ if (defined $cgi->param('product')) {
}
if (defined $cgi->param('maketemplate')) {
- $vars->{'url'} = $::buffer;
+ $vars->{'url'} = $cgi->query_string();
print $cgi->header();
$template->process("bug/create/make-template.html.tmpl", $vars)
diff --git a/process_bug.cgi b/process_bug.cgi
index 9a3db0a8f..c624eff3a 100755
--- a/process_bug.cgi
+++ b/process_bug.cgi
@@ -46,7 +46,7 @@ my $PrivilegesRequired = 0;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Bug;
diff --git a/query.cgi b/query.cgi
index ff04c15a0..a25f8535d 100755
--- a/query.cgi
+++ b/query.cgi
@@ -28,7 +28,7 @@
use strict;
use lib ".";
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::Search;
@@ -36,7 +36,6 @@ use Bugzilla::User;
use Bugzilla::Util;
use vars qw(
- @CheckOptionValues
@legal_resolution
@legal_bug_status
@legal_components
@@ -57,6 +56,7 @@ use vars qw(
my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
+my $buffer = $cgi->query_string();
if ($cgi->param("GoAheadAndLogIn")) {
# We got here from a login page, probably from relogin.cgi. We better
@@ -112,7 +112,7 @@ if ($cgi->param('nukedefaultquery')) {
" WHERE userid = ? AND name = ?",
undef, ($userid, DEFAULT_QUERY_NAME));
}
- $::buffer = "";
+ $buffer = "";
}
my $userdefaultquery;
@@ -200,7 +200,7 @@ sub PrefillForm {
}
-if (!PrefillForm($::buffer)) {
+if (!PrefillForm($buffer)) {
# Ah-hah, there was no form stuff specified. Do it again with the
# default query.
if ($userdefaultquery) {
diff --git a/quips.cgi b/quips.cgi
index d811ee5fe..364f51448 100755
--- a/quips.cgi
+++ b/quips.cgi
@@ -25,15 +25,11 @@
use strict;
-use vars qw(
- $userid
- $template
- $vars
-);
+use vars qw($userid $template $vars);
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
diff --git a/relogin.cgi b/relogin.cgi
index 6843405c2..f743eb8f3 100755
--- a/relogin.cgi
+++ b/relogin.cgi
@@ -23,11 +23,9 @@
use strict;
-use vars qw($template $vars);
-
use lib qw(.);
-
-require "CGI.pl";
+use Bugzilla;
+use Bugzilla::Error;
# We don't want to remove a random logincookie from the db, so
# call Bugzilla->login(). If we're logged in after this, then
@@ -36,9 +34,11 @@ Bugzilla->login();
Bugzilla->logout();
+my $template = Bugzilla->template;
my $cgi = Bugzilla->cgi;
print $cgi->header();
+my $vars = {};
$vars->{'message'} = "logged_out";
$template->process("global/message.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
diff --git a/report.cgi b/report.cgi
index 30c7cade8..e7b94ffc2 100755
--- a/report.cgi
+++ b/report.cgi
@@ -24,7 +24,7 @@
use strict;
use lib ".";
-require "CGI.pl";
+require "globals.pl";
use vars qw($template $vars @legal_opsys @legal_platform @legal_severity);
@@ -32,6 +32,7 @@ use Bugzilla;
use Bugzilla::Constants;
my $cgi = Bugzilla->cgi;
+my $buffer = $cgi->query_string();
# Go straight back to query.cgi if we are adding a boolean chart.
if (grep(/^cmd-/, $cgi->param())) {
@@ -266,9 +267,9 @@ if ($action eq "wrap") {
# We need to keep track of the defined restrictions on each of the
# axes, because buglistbase, below, throws them away. Without this, we
# get buglistlinks wrong if there is a restriction on an axis field.
- $vars->{'col_vals'} = join("&", $::buffer =~ /[&?]($col_field=[^&]+)/g);
- $vars->{'row_vals'} = join("&", $::buffer =~ /[&?]($row_field=[^&]+)/g);
- $vars->{'tbl_vals'} = join("&", $::buffer =~ /[&?]($tbl_field=[^&]+)/g);
+ $vars->{'col_vals'} = join("&", $buffer =~ /[&?]($col_field=[^&]+)/g);
+ $vars->{'row_vals'} = join("&", $buffer =~ /[&?]($row_field=[^&]+)/g);
+ $vars->{'tbl_vals'} = join("&", $buffer =~ /[&?]($tbl_field=[^&]+)/g);
# We need a number of different variants of the base URL for different
# URLs in the HTML.
diff --git a/reports.cgi b/reports.cgi
index e8191a0d0..49948e2bb 100755
--- a/reports.cgi
+++ b/reports.cgi
@@ -39,8 +39,6 @@ use lib qw(.);
use Bugzilla::Config qw(:DEFAULT $datadir);
-require "CGI.pl";
-
require "globals.pl";
use vars qw(@legal_product); # globals from er, globals.pl
diff --git a/request.cgi b/request.cgi
index 4c6e7600f..a3779bd8d 100755
--- a/request.cgi
+++ b/request.cgi
@@ -29,7 +29,7 @@ use strict;
# Include the Bugzilla CGI and general utility library.
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
# Use Bugzilla's Request module which contains utilities for handling requests.
use Bugzilla::Flag;
diff --git a/sanitycheck.cgi b/sanitycheck.cgi
index 00a7ef0c5..1035a8d2e 100755
--- a/sanitycheck.cgi
+++ b/sanitycheck.cgi
@@ -27,7 +27,7 @@ use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Constants;
use Bugzilla::User;
diff --git a/show_activity.cgi b/show_activity.cgi
index eacaeba37..b0ad42379 100755
--- a/show_activity.cgi
+++ b/show_activity.cgi
@@ -27,7 +27,7 @@ use strict;
use lib qw(.);
use vars qw ($template $vars);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::Bug;
@@ -54,7 +54,7 @@ ValidateBugID($bug_id);
$vars->{'bug_id'} = $bug_id;
-print Bugzilla->cgi->header();
+print $cgi->header();
$template->process("bug/activity/show.html.tmpl", $vars)
|| ThrowTemplateError($template->error());
diff --git a/show_bug.cgi b/show_bug.cgi
index e855b442f..c45a7cd99 100755
--- a/show_bug.cgi
+++ b/show_bug.cgi
@@ -28,7 +28,7 @@ use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
use vars qw($template $vars $userid);
diff --git a/showdependencygraph.cgi b/showdependencygraph.cgi
index 8f0ff5dfa..4339bb3e5 100755
--- a/showdependencygraph.cgi
+++ b/showdependencygraph.cgi
@@ -32,7 +32,7 @@ use Bugzilla::Util;
use Bugzilla::BugMail;
use Bugzilla::Bug;
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login();
diff --git a/showdependencytree.cgi b/showdependencytree.cgi
index e473357d1..7c3b99465 100755
--- a/showdependencytree.cgi
+++ b/showdependencytree.cgi
@@ -26,7 +26,7 @@
use strict;
use lib qw(.);
-require "CGI.pl";
+require "globals.pl";
use Bugzilla::User;
use Bugzilla::Bug;
diff --git a/sidebar.cgi b/sidebar.cgi
index 73a22d1b3..15506eba4 100755
--- a/sidebar.cgi
+++ b/sidebar.cgi
@@ -18,13 +18,10 @@
use strict;
use lib ".";
-require "CGI.pl";
+require "globals.pl";
# Shut up "Used Only Once" errors
-use vars qw(
- $template
- $vars
-);
+use vars qw($template $vars);
Bugzilla->login();
diff --git a/summarize_time.cgi b/summarize_time.cgi
index eb3aff230..31aedd9e1 100755
--- a/summarize_time.cgi
+++ b/summarize_time.cgi
@@ -27,7 +27,7 @@ use Bugzilla::Bug; # EmitDependList
use Bugzilla::Util; # trim
use Bugzilla::Constants; # LOGIN_*
use Bugzilla::User; # UserInGroup
-require "CGI.pl";
+require "globals.pl";
GetVersionTable();
diff --git a/template/en/default/global/help-header.html.tmpl b/template/en/default/global/help-header.html.tmpl
index 330ba9160..96814e93f 100644
--- a/template/en/default/global/help-header.html.tmpl
+++ b/template/en/default/global/help-header.html.tmpl
@@ -22,7 +22,7 @@
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]
-[% IF help %]
+[% IF cgi.param("help") %]
[% IF cgi.user_agent("Mozilla/5") %]
<style type="text/css">
.help {
diff --git a/template/en/default/global/help.html.tmpl b/template/en/default/global/help.html.tmpl
index 2095a0dcd..cc69534da 100644
--- a/template/en/default/global/help.html.tmpl
+++ b/template/en/default/global/help.html.tmpl
@@ -22,7 +22,7 @@
[% USE Bugzilla %]
[% cgi = Bugzilla.cgi %]
-[% IF help %]
+[% IF cgi.param("help") %]
[% IF cgi.user_agent("Mozilla/5") %]
[% FOREACH h = help_html %]
<div id="[% h.id %]_help" class="help" style="display: none;">
diff --git a/template/en/default/search/search-advanced.html.tmpl b/template/en/default/search/search-advanced.html.tmpl
index 880715c35..e55c71ba1 100644
--- a/template/en/default/search/search-advanced.html.tmpl
+++ b/template/en/default/search/search-advanced.html.tmpl
@@ -51,7 +51,7 @@ var queryform = "queryform"
[% button_name = "Search" %]
[%# The decent help requires Javascript %]
-[% IF NOT help %]
+[% IF NOT cgi.param("help") %]
[% IF cgi.user_agent("Mozilla/5") %]
<script type="text/javascript"> <!--
document.write("<p><a href='query.cgi?help=1&amp;format=advanced'>Give me some help</a> (reloads page.)</p>");
@@ -82,6 +82,6 @@ var queryform = "queryform"
</form>
-[% PROCESS "search/search-help.html.tmpl" IF help %]
+[% PROCESS "search/search-help.html.tmpl" IF cgi.param("help") %]
[% PROCESS global/footer.html.tmpl %]
diff --git a/token.cgi b/token.cgi
index f3e7bd7ce..1d398f84d 100755
--- a/token.cgi
+++ b/token.cgi
@@ -39,7 +39,7 @@ my $cgi = Bugzilla->cgi;
my $dbh = Bugzilla->dbh;
# Include the Bugzilla CGI and general utility library.
-require "CGI.pl";
+require "globals.pl";
Bugzilla->login(LOGIN_OPTIONAL);
diff --git a/userprefs.cgi b/userprefs.cgi
index 42ef255d3..9d475f16c 100755
--- a/userprefs.cgi
+++ b/userprefs.cgi
@@ -32,7 +32,7 @@ use Bugzilla::Search;
use Bugzilla::Util;
use Bugzilla::User;
-require "CGI.pl";
+require "globals.pl";
# Use global template variables.
use vars qw($template $vars $userid);
diff --git a/votes.cgi b/votes.cgi
index 3d1ac7113..8d7e7cf63 100755
--- a/votes.cgi
+++ b/votes.cgi
@@ -30,7 +30,7 @@ use Bugzilla;
use Bugzilla::Constants;
use Bugzilla::Bug;
-require "CGI.pl";
+require "globals.pl";
# Use global template variables
use vars qw($template $vars);
diff --git a/xml.cgi b/xml.cgi
index 103838f86..8316971c9 100755
--- a/xml.cgi
+++ b/xml.cgi
@@ -25,10 +25,9 @@
use strict;
use lib qw(.);
+use Bugzilla;
-require "CGI.pl";
-
-our $cgi;
+my $cgi = Bugzilla->cgi;
# Convert comma/space separated elements into separate params
my @ids = ();