From b259c4b4252cde8e7926690f6ba419d2ee7c59fc Mon Sep 17 00:00:00 2001 From: "bbaetz%acm.org" <> Date: Wed, 2 Apr 2003 20:35:00 +0000 Subject: Bug 199813 - Make all users of ThrowUserError pass $vars in explicitly. r=gerv a=justdave --- CGI.pl | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) (limited to 'CGI.pl') 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 -- cgit v1.2.3-24-g4f1b