]> source.dussan.org Git - redmine.git/commitdiff
Email address with Punycode top-level domain is not accepted (#32793).
authorJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 5 Apr 2020 09:55:22 +0000 (09:55 +0000)
committerJean-Philippe Lang <jp_lang@yahoo.fr>
Sun, 5 Apr 2020 09:55:22 +0000 (09:55 +0000)
Patch by Go MAEDA.

git-svn-id: http://svn.redmine.org/redmine/trunk@19660 e93f8b46-1217-0410-a6f0-8f06a7374b81

app/models/email_address.rb

index 4cd9c5dfd0f6e4fd6c86ba206ecdba2e869d84e2..b27cf6e58915aa707fb045b3f64da11341a54b01 100644 (file)
@@ -20,7 +20,7 @@
 class EmailAddress < ActiveRecord::Base
   include Redmine::SafeAttributes
 
-  EMAIL_REGEXP = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})\z/i
+  EMAIL_REGEXP = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+(?:(?:xn--[-a-z0-9]+)|(?:[a-z]{2,})))\z/i
 
   belongs_to :user