summaryrefslogtreecommitdiffstats
path: root/editflagtypes.cgi
diff options
context:
space:
mode:
authorlpsolit%gmail.com <>2005-12-14 06:32:51 +0100
committerlpsolit%gmail.com <>2005-12-14 06:32:51 +0100
commit6ca81cd002656534e9f9df711eb99e85c69b54b5 (patch)
treed4f7efc3f0812909d65ff4da4fee996c4b127a20 /editflagtypes.cgi
parent6cbc51f437e951177e7ef35f4779cdf1b23a88b7 (diff)
downloadbugzilla-6ca81cd002656534e9f9df711eb99e85c69b54b5.tar.gz
bugzilla-6ca81cd002656534e9f9df711eb99e85c69b54b5.tar.xz
Bug 278414: Cannot add 'cc' notification for Flags when using emailsuffixes - Patch by Frédéric Buclin <LpSolit@gmail.com> r=wurblzap a=justdave
Diffstat (limited to 'editflagtypes.cgi')
-rwxr-xr-xeditflagtypes.cgi12
1 files changed, 10 insertions, 2 deletions
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;