]> git.ipfire.org Git - thirdparty/bugzilla.git/commitdiff
Bug 278414: Cannot add 'cc' notification for Flags when using emailsuffixes - Patch...
authorlpsolit%gmail.com <>
Wed, 14 Dec 2005 05:39:06 +0000 (05:39 +0000)
committerlpsolit%gmail.com <>
Wed, 14 Dec 2005 05:39:06 +0000 (05:39 +0000)
editflagtypes.cgi
template/en/default/global/user-error.html.tmpl

index bdf0779b4d19527bcfae91e580b51359c4159d29..b7131df997dac2d86aa2f5a31c5391cc53f3fa38 100755 (executable)
@@ -488,7 +488,18 @@ sub validateCCList {
                         { cc_list => $cgi->param('cc_list') });
     
     my @addresses = split(/[, ]+/, $cgi->param('cc_list'));
-    foreach my $address (@addresses) { CheckEmailSyntax($address) }
+    # 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) {
+        ($address =~ /^[\w\.\+\-=]+@[\w\.\-]+\.[\w\-]+$/
+           && $address !~ /[\\\(\)<>&,;:"\[\] \t\r\n]/)
+          || ThrowUserError('illegal_email_address',
+                            {addr => $address, default => 1});
+    }
 }
 
 sub validateProduct {
index 57df2404591d2f659e1507bcae832b889602bc6f..683132a14d4fc6b5f263595ae6fde66dbd53d5ee 100644 (file)
   [% ELSIF error == "illegal_email_address" %]
     [% title = "Invalid Email Address" %]
     The e-mail address you entered (<b>[% addr FILTER html %]</b>) 
-    didn't pass our syntax checking for a legal email address. 
-    [%+ Param('emailregexpdesc') %]
+    didn't pass our syntax checking for a legal email address.
+    [% IF default %]
+      A legal address must contain exactly one '@',
+      and at least one '.' after the @.
+    [% ELSE %]
+      [%+ Param('emailregexpdesc') %]
+    [% END %]
     It must also not contain any of these special characters:
     <tt>\ ( ) &amp; &lt; &gt; , ; : &quot; [ ]</tt>, or any whitespace.