aboutsummaryrefslogtreecommitdiff
path: root/CGI.pl
diff options
context:
space:
mode:
authorbbaetz%acm.org <>2003-04-02 20:35:00 +0000
committerbbaetz%acm.org <>2003-04-02 20:35:00 +0000
commitb259c4b4252cde8e7926690f6ba419d2ee7c59fc (patch)
treeae51804f9db83c0b1a49f79b9e0a1848cdd5e7c7 /CGI.pl
parentBug 195424 - Add a note about new MySQL permissions needed for Bugzilla in My... (diff)
downloadbugzilla-b259c4b4252cde8e7926690f6ba419d2ee7c59fc.tar.gz
bugzilla-b259c4b4252cde8e7926690f6ba419d2ee7c59fc.tar.bz2
bugzilla-b259c4b4252cde8e7926690f6ba419d2ee7c59fc.zip
Bug 199813 - Make all users of ThrowUserError pass $vars in explicitly.
r=gerv a=justdave
Diffstat (limited to 'CGI.pl')
-rw-r--r--CGI.pl22
1 files changed, 2 insertions, 20 deletions
diff --git a/CGI.pl b/CGI.pl
index 8ce589ced..74b81c9da 100644
--- a/CGI.pl
+++ b/CGI.pl
@@ -35,6 +35,7 @@ use lib ".";
use Bugzilla::Util;
use Bugzilla::Config;
use Bugzilla::Constants;
+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.
@@ -252,8 +253,7 @@ sub CheckEmailSyntax {
my ($addr) = (@_);
my $match = Param('emailregexp');
if ($addr !~ /$match/ || $addr =~ /[\\\(\)<>&,;:"\[\] \t\r\n]/) {
- $vars->{'addr'} = $addr;
- ThrowUserError("illegal_email_address");
+ ThrowUserError("illegal_email_address", { addr => $addr });
}
}
@@ -327,24 +327,6 @@ sub ThrowCodeError {
exit;
}
-# For errors made by the user.
-sub ThrowUserError {
- ($vars->{'error'}, my $extra_vars, my $unlock_tables) = (@_);
-
- SendSQL("UNLOCK TABLES") if $unlock_tables;
-
- # Copy the extra_vars into the vars hash
- foreach my $var (keys %$extra_vars) {
- $vars->{$var} = $extra_vars->{$var};
- }
-
- print "Content-type: text/html\n\n" if !$vars->{'header_done'};
- $template->process("global/user-error.html.tmpl", $vars)
- || ThrowTemplateError($template->error());
-
- exit;
-}
-
# This function should only be called if a template->process() fails.
# It tries another template first, because often one template being
# broken or missing doesn't mean that they all are. But it falls back on