From: Jean-Philippe Lang Date: Sun, 5 Apr 2020 09:55:22 +0000 (+0000) Subject: Email address with Punycode top-level domain is not accepted (#32793). X-Git-Tag: 4.2.0~1101 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=87b56c65217c3c6d742b5e3c764982620c863055;p=redmine.git Email address with Punycode top-level domain is not accepted (#32793). Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@19660 e93f8b46-1217-0410-a6f0-8f06a7374b81 --- diff --git a/app/models/email_address.rb b/app/models/email_address.rb index 4cd9c5dfd..b27cf6e58 100644 --- a/app/models/email_address.rb +++ b/app/models/email_address.rb @@ -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