summaryrefslogtreecommitdiffstats
path: root/CGI.pl
diff options
context:
space:
mode:
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