From a8d486f5727da1d737e612c93bf1a7fab100682e Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" Date: Wed, 10 Aug 2005 01:30:41 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20301508:=20Remove=20CGI.pl=20-=20Patch=20b?= =?UTF-8?q?y=20Fr=EF=BF=BDd=EF=BF=BDric=20Buclin=20=20r?= =?UTF-8?q?=3Dmkanat,wicked=20a=3Djustdave?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- webtools/bugzilla/Bugzilla/Attachment.pm | 4 +- webtools/bugzilla/Bugzilla/Flag.pm | 5 +- webtools/bugzilla/Bugzilla/FlagType.pm | 3 +- webtools/bugzilla/Bugzilla/Search.pm | 2 +- webtools/bugzilla/Bugzilla/Token.pm | 4 +- webtools/bugzilla/CGI.pl | 67 ------------------- webtools/bugzilla/attachment.cgi | 26 +++---- webtools/bugzilla/buglist.cgi | 23 ++++--- webtools/bugzilla/chart.cgi | 9 ++- webtools/bugzilla/colchange.cgi | 5 +- webtools/bugzilla/config.cgi | 2 +- .../bugzilla/contrib/sendunsentbugmail.pl | 2 +- webtools/bugzilla/contrib/syncLDAP.pl | 2 +- webtools/bugzilla/createaccount.cgi | 2 +- webtools/bugzilla/describecomponents.cgi | 2 +- webtools/bugzilla/describekeywords.cgi | 2 +- webtools/bugzilla/doeditparams.cgi | 2 +- webtools/bugzilla/duplicates.cgi | 1 - webtools/bugzilla/editcomponents.cgi | 2 +- webtools/bugzilla/editflagtypes.cgi | 2 +- webtools/bugzilla/editgroups.cgi | 2 +- webtools/bugzilla/editkeywords.cgi | 2 +- webtools/bugzilla/editmilestones.cgi | 1 - webtools/bugzilla/editparams.cgi | 2 +- webtools/bugzilla/editproducts.cgi | 1 - webtools/bugzilla/editsettings.cgi | 2 +- webtools/bugzilla/editusers.cgi | 1 - webtools/bugzilla/editversions.cgi | 1 - webtools/bugzilla/editwhines.cgi | 1 - webtools/bugzilla/enter_bug.cgi | 2 +- webtools/bugzilla/globals.pl | 1 + webtools/bugzilla/importxml.pl | 1 - webtools/bugzilla/index.cgi | 6 +- webtools/bugzilla/long_list.cgi | 5 +- webtools/bugzilla/move.pl | 2 +- webtools/bugzilla/page.cgi | 2 +- webtools/bugzilla/post_bug.cgi | 7 +- webtools/bugzilla/process_bug.cgi | 2 +- webtools/bugzilla/query.cgi | 8 +-- webtools/bugzilla/quips.cgi | 8 +-- webtools/bugzilla/relogin.cgi | 8 +-- webtools/bugzilla/report.cgi | 9 +-- webtools/bugzilla/reports.cgi | 2 - webtools/bugzilla/request.cgi | 2 +- webtools/bugzilla/sanitycheck.cgi | 2 +- webtools/bugzilla/show_activity.cgi | 4 +- webtools/bugzilla/show_bug.cgi | 2 +- webtools/bugzilla/showdependencygraph.cgi | 2 +- webtools/bugzilla/showdependencytree.cgi | 2 +- webtools/bugzilla/sidebar.cgi | 7 +- webtools/bugzilla/summarize_time.cgi | 2 +- .../en/default/global/help-header.html.tmpl | 2 +- .../template/en/default/global/help.html.tmpl | 2 +- .../default/search/search-advanced.html.tmpl | 4 +- webtools/bugzilla/token.cgi | 2 +- webtools/bugzilla/userprefs.cgi | 2 +- webtools/bugzilla/votes.cgi | 2 +- webtools/bugzilla/xml.cgi | 5 +- 58 files changed, 97 insertions(+), 188 deletions(-) delete mode 100644 webtools/bugzilla/CGI.pl diff --git a/webtools/bugzilla/Bugzilla/Attachment.pm b/webtools/bugzilla/Bugzilla/Attachment.pm index 10fa6ddfc201..78f4ceed56bc 100644 --- a/webtools/bugzilla/Bugzilla/Attachment.pm +++ b/webtools/bugzilla/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/webtools/bugzilla/Bugzilla/Flag.pm b/webtools/bugzilla/Bugzilla/Flag.pm index 65636d78c3f5..6c5adf440bf8 100644 --- a/webtools/bugzilla/Bugzilla/Flag.pm +++ b/webtools/bugzilla/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. This will eventually change in a -future version when CGI.pl is removed. +already done a C. =item * -Import relevant functions from that script and its companion globals.pl. +Import relevant functions from that script. =item * diff --git a/webtools/bugzilla/Bugzilla/FlagType.pm b/webtools/bugzilla/Bugzilla/FlagType.pm index 49c9f777e8d5..678721b5f038 100644 --- a/webtools/bugzilla/Bugzilla/FlagType.pm +++ b/webtools/bugzilla/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. This will eventually change in a -future version when CGI.pl is removed. +already done a C. =item * diff --git a/webtools/bugzilla/Bugzilla/Search.pm b/webtools/bugzilla/Bugzilla/Search.pm index 31dbcd2ab549..0b1ac94bace6 100644 --- a/webtools/bugzilla/Bugzilla/Search.pm +++ b/webtools/bugzilla/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/webtools/bugzilla/Bugzilla/Token.pm b/webtools/bugzilla/Bugzilla/Token.pm index fe72915a36b4..44ee1a642de4 100644 --- a/webtools/bugzilla/Bugzilla/Token.pm +++ b/webtools/bugzilla/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/webtools/bugzilla/CGI.pl b/webtools/bugzilla/CGI.pl deleted file mode 100644 index c1b8aca1141f..000000000000 --- a/webtools/bugzilla/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 -# Dan Mosedale -# Joe Robins -# Dave Miller -# Christopher Aillon -# Gervase Markham -# Christian Reis - -# 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/webtools/bugzilla/attachment.cgi b/webtools/bugzilla/attachment.cgi index 1ed7a2322091..ea04e2c19902 100755 --- a/webtools/bugzilla/attachment.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/buglist.cgi b/webtools/bugzilla/buglist.cgi index 45c0db5524a4..6bc3af291c78 100755 --- a/webtools/bugzilla/buglist.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/chart.cgi b/webtools/bugzilla/chart.cgi index bc25d52e919c..31f961cacff0 100755 --- a/webtools/bugzilla/chart.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/colchange.cgi b/webtools/bugzilla/colchange.cgi index 30103406fd33..e99b81b70773 100755 --- a/webtools/bugzilla/colchange.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/config.cgi b/webtools/bugzilla/config.cgi index 1306c0b66868..bbffe20d85ea 100755 --- a/webtools/bugzilla/config.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/contrib/sendunsentbugmail.pl b/webtools/bugzilla/contrib/sendunsentbugmail.pl index c82c0ae30c49..9453a6538e0c 100755 --- a/webtools/bugzilla/contrib/sendunsentbugmail.pl +++ b/webtools/bugzilla/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/webtools/bugzilla/contrib/syncLDAP.pl b/webtools/bugzilla/contrib/syncLDAP.pl index 14ba1402cea0..6e78854e05bd 100755 --- a/webtools/bugzilla/contrib/syncLDAP.pl +++ b/webtools/bugzilla/contrib/syncLDAP.pl @@ -23,7 +23,7 @@ use strict; -require "CGI.pl"; +require "globals.pl"; use lib qw(.); diff --git a/webtools/bugzilla/createaccount.cgi b/webtools/bugzilla/createaccount.cgi index 337f89d0a18a..29b3c00ec3ab 100755 --- a/webtools/bugzilla/createaccount.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/describecomponents.cgi b/webtools/bugzilla/describecomponents.cgi index 8e175549814a..9602c0fe0bba 100755 --- a/webtools/bugzilla/describecomponents.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/describekeywords.cgi b/webtools/bugzilla/describekeywords.cgi index e7b3b759b539..ab88c2f152b0 100755 --- a/webtools/bugzilla/describekeywords.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/doeditparams.cgi b/webtools/bugzilla/doeditparams.cgi index 431aa91c2f51..cfc21e23d21c 100755 --- a/webtools/bugzilla/doeditparams.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/duplicates.cgi b/webtools/bugzilla/duplicates.cgi index 744ad814730f..92c697f53454 100755 --- a/webtools/bugzilla/duplicates.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/editcomponents.cgi b/webtools/bugzilla/editcomponents.cgi index 6f8bc99f22ef..c25f971fc570 100755 --- a/webtools/bugzilla/editcomponents.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/editflagtypes.cgi b/webtools/bugzilla/editflagtypes.cgi index 57795f4933a7..ec449a87d4b1 100755 --- a/webtools/bugzilla/editflagtypes.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/editgroups.cgi b/webtools/bugzilla/editgroups.cgi index 5e74163dafd7..e41dc7d073ec 100755 --- a/webtools/bugzilla/editgroups.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/editkeywords.cgi b/webtools/bugzilla/editkeywords.cgi index 8ad74710e80b..3062e3dede1a 100755 --- a/webtools/bugzilla/editkeywords.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/editmilestones.cgi b/webtools/bugzilla/editmilestones.cgi index 4fbcab0468b5..fa1117ede240 100755 --- a/webtools/bugzilla/editmilestones.cgi +++ b/webtools/bugzilla/editmilestones.cgi @@ -19,7 +19,6 @@ use strict; use lib "."; -require "CGI.pl"; require "globals.pl"; use Bugzilla::Constants; diff --git a/webtools/bugzilla/editparams.cgi b/webtools/bugzilla/editparams.cgi index 668a138017e3..264e991a4f73 100755 --- a/webtools/bugzilla/editparams.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/editproducts.cgi b/webtools/bugzilla/editproducts.cgi index 18e845efc517..cacf8eef865c 100755 --- a/webtools/bugzilla/editproducts.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/editsettings.cgi b/webtools/bugzilla/editsettings.cgi index 80a8921d5615..742bd71766fa 100755 --- a/webtools/bugzilla/editsettings.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/editusers.cgi b/webtools/bugzilla/editusers.cgi index 9da66424d7ec..f628752cdde1 100755 --- a/webtools/bugzilla/editusers.cgi +++ b/webtools/bugzilla/editusers.cgi @@ -18,7 +18,6 @@ use strict; use lib "."; -require "CGI.pl"; require "globals.pl"; use vars qw( $vars ); diff --git a/webtools/bugzilla/editversions.cgi b/webtools/bugzilla/editversions.cgi index a7ced7df3009..cf2303e5f9f1 100755 --- a/webtools/bugzilla/editversions.cgi +++ b/webtools/bugzilla/editversions.cgi @@ -31,7 +31,6 @@ use strict; use lib "."; -require "CGI.pl"; require "globals.pl"; use Bugzilla::Constants; diff --git a/webtools/bugzilla/editwhines.cgi b/webtools/bugzilla/editwhines.cgi index 1f5c954f3994..66387dd82ee5 100755 --- a/webtools/bugzilla/editwhines.cgi +++ b/webtools/bugzilla/editwhines.cgi @@ -28,7 +28,6 @@ use strict; use lib "."; -require "CGI.pl"; require "globals.pl"; use vars qw( $vars ); diff --git a/webtools/bugzilla/enter_bug.cgi b/webtools/bugzilla/enter_bug.cgi index f3437b7ed0d1..1d85761b4968 100755 --- a/webtools/bugzilla/enter_bug.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/globals.pl b/webtools/bugzilla/globals.pl index f8f070366117..d4ba17004eab 100644 --- a/webtools/bugzilla/globals.pl +++ b/webtools/bugzilla/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/webtools/bugzilla/importxml.pl b/webtools/bugzilla/importxml.pl index 0d9dcb868378..9c56b3d1a385 100755 --- a/webtools/bugzilla/importxml.pl +++ b/webtools/bugzilla/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/webtools/bugzilla/index.cgi b/webtools/bugzilla/index.cgi index 88393b417877..bc3a1272fcbf 100755 --- a/webtools/bugzilla/index.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/long_list.cgi b/webtools/bugzilla/long_list.cgi index 04758729d0b2..a5d59909bc87 100755 --- a/webtools/bugzilla/long_list.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/move.pl b/webtools/bugzilla/move.pl index 92a051b63467..82c40034db09 100755 --- a/webtools/bugzilla/move.pl +++ b/webtools/bugzilla/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/webtools/bugzilla/page.cgi b/webtools/bugzilla/page.cgi index 6e78317fc06f..9954c64a8f27 100755 --- a/webtools/bugzilla/page.cgi +++ b/webtools/bugzilla/page.cgi @@ -34,7 +34,7 @@ use lib "."; use Bugzilla; -require "CGI.pl"; +require "globals.pl"; use vars qw($template $vars); diff --git a/webtools/bugzilla/post_bug.cgi b/webtools/bugzilla/post_bug.cgi index 01c0e18452e2..0c421b638034 100755 --- a/webtools/bugzilla/post_bug.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/process_bug.cgi b/webtools/bugzilla/process_bug.cgi index 9a3db0a8f1f7..c624eff3ae46 100755 --- a/webtools/bugzilla/process_bug.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/query.cgi b/webtools/bugzilla/query.cgi index ff04c15a0cd5..a25f8535dce5 100755 --- a/webtools/bugzilla/query.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/quips.cgi b/webtools/bugzilla/quips.cgi index d811ee5fe45d..364f51448d8e 100755 --- a/webtools/bugzilla/quips.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/relogin.cgi b/webtools/bugzilla/relogin.cgi index 6843405c20ef..f743eb8f3eb3 100755 --- a/webtools/bugzilla/relogin.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/report.cgi b/webtools/bugzilla/report.cgi index 30c7cade8731..e7b94ffc2aa8 100755 --- a/webtools/bugzilla/report.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/reports.cgi b/webtools/bugzilla/reports.cgi index e8191a0d0435..49948e2bb232 100755 --- a/webtools/bugzilla/reports.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/request.cgi b/webtools/bugzilla/request.cgi index 4c6e7600f227..a3779bd8dcf4 100755 --- a/webtools/bugzilla/request.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/sanitycheck.cgi b/webtools/bugzilla/sanitycheck.cgi index 00a7ef0c5352..1035a8d2e91b 100755 --- a/webtools/bugzilla/sanitycheck.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/show_activity.cgi b/webtools/bugzilla/show_activity.cgi index eacaeba372b3..b0ad42379c07 100755 --- a/webtools/bugzilla/show_activity.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/show_bug.cgi b/webtools/bugzilla/show_bug.cgi index e855b442f2c1..c45a7cd99709 100755 --- a/webtools/bugzilla/show_bug.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/showdependencygraph.cgi b/webtools/bugzilla/showdependencygraph.cgi index 8f0ff5dfafe5..4339bb3e595f 100755 --- a/webtools/bugzilla/showdependencygraph.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/showdependencytree.cgi b/webtools/bugzilla/showdependencytree.cgi index e473357d1460..7c3b9946512f 100755 --- a/webtools/bugzilla/showdependencytree.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/sidebar.cgi b/webtools/bugzilla/sidebar.cgi index 73a22d1b339a..15506eba43e9 100755 --- a/webtools/bugzilla/sidebar.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/summarize_time.cgi b/webtools/bugzilla/summarize_time.cgi index eb3aff23067c..31aedd9e1ef6 100755 --- a/webtools/bugzilla/summarize_time.cgi +++ b/webtools/bugzilla/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/webtools/bugzilla/template/en/default/global/help-header.html.tmpl b/webtools/bugzilla/template/en/default/global/help-header.html.tmpl index 330ba9160a15..96814e93fd51 100644 --- a/webtools/bugzilla/template/en/default/global/help-header.html.tmpl +++ b/webtools/bugzilla/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") %]