From 6ca81cd002656534e9f9df711eb99e85c69b54b5 Mon Sep 17 00:00:00 2001 From: "lpsolit%gmail.com" <> Date: Wed, 14 Dec 2005 05:32:51 +0000 Subject: Bug 278414: Cannot add 'cc' notification for Flags when using emailsuffixes - Patch by Frédéric Buclin r=wurblzap a=justdave MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- editflagtypes.cgi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'editflagtypes.cgi') diff --git a/editflagtypes.cgi b/editflagtypes.cgi index 795ce985e..c8eb159c2 100755 --- a/editflagtypes.cgi +++ b/editflagtypes.cgi @@ -498,9 +498,17 @@ sub validateCCList { { cc_list => $cc_list }); my @addresses = split(/[, ]+/, $cc_list); + # We do not call Util::validate_email_syntax because these + # addresses do not require to match 'emailregexp' and do not + # depend on 'emailsuffix'. So we limit ourselves to a simple + # sanity check: + # - match the syntax of a fully qualified email address; + # - do not contain any illegal character. foreach my $address (@addresses) { - validate_email_syntax($address) - || ThrowUserError('illegal_email_address', {addr => $address}); + ($address =~ /^[\w\.\+\-=]+@[\w\.\-]+\.[\w\-]+$/ + && $address !~ /[\\\(\)<>&,;:"\[\] \t\r\n]/) + || ThrowUserError('illegal_email_address', + {addr => $address, default => 1}); } trick_taint($cc_list); return $cc_list; -- cgit v1.2.3-24-g4f1b