From f208e298e2ac9836c8138449a0691f6deb850c4a Mon Sep 17 00:00:00 2001 From: "justdave%syndicomm.com" <> Date: Wed, 4 Jul 2001 14:05:59 +0000 Subject: Fix for bug 87701: Invalid username in bug changes echoed back without escaping HTML data Patch by Gervase Markham r= justdave@syndicomm.com --- CGI.pl | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'CGI.pl') diff --git a/CGI.pl b/CGI.pl index 09ab23c07..d7782f7e8 100644 --- a/CGI.pl +++ b/CGI.pl @@ -659,7 +659,7 @@ sub quietly_check_login() { sub CheckEmailSyntax { my ($addr) = (@_); my $match = Param('emailregexp'); - if ($addr !~ /$match/) { + if ($addr !~ /$match/ || $addr =~ /[\\\(\)<>&,;:"\[\] \t\r\n]/) { print "Content-type: text/html\n\n"; # For security, escape HTML special characters. @@ -669,8 +669,11 @@ sub CheckEmailSyntax { print "The e-mail address you entered\n"; print "($addr) didn't match our minimal\n"; print "syntax checking for a legal email address.\n"; - print Param('emailregexpdesc'); - print "

Please click back and try again.\n"; + print Param('emailregexpdesc') . "\n"; + print "It must also not contain any of these special characters: " . + "\\ ( ) & < > , ; : \" [ ] " . + "or any whitespace.\n"; + print "

Please click Back and try again.\n"; PutFooter(); exit; } -- cgit v1.2.3-24-g4f1b