]> git.openstreetmap.org Git - rails.git/commitdiff
make email regex slightly more readable
authorBoubacar <boubacar.diallo1@macaulay.cuny.edu>
Mon, 17 Feb 2020 16:39:30 +0000 (11:39 -0500)
committerBoubacar <boubacar.diallo1@macaulay.cuny.edu>
Mon, 17 Feb 2020 16:39:30 +0000 (11:39 -0500)
app/helpers/browse_tags_helper.rb

index 2a1496f1355ae807a5e9dde73a076e6c1dbcca67..d4294daaa7b1361b2f0051b181c8cfd89b10df25 100644 (file)
@@ -136,8 +136,10 @@ module BrowseTagsHelper
     # Uses WHATWG implementation of email validation, which follows RFC 1123
     # but is a willful violation of RFC 5322.
     #  (see: https://html.spec.whatwg.org/multipage/input.html#valid-e-mail-address)
-    if value.match?(%r{^\s*[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\s*
-                      (;\s*[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\s*)*$
+    if value.match?(%r{^\s*[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+
+                          @[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\s*
+                      (;\s*[a-zA-Z0-9.!#$%&'*+\/=?^_`{|}~-]+
+                          @[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*\s*)*$
                     }x)
       return value.split(";").map do |email|
         # remove any leading or trailing whitespace if present