Project

General

Profile

Defect #36969

Updated by Mischa The Evil over 2 years ago

There is a regex in the @EmailAddress@ EmailAddress class, that matches matchs some invalid email address like these: these:<pre> 
 <pre> 
 test,email@example.com 
 ,test@example.com 
 $test@example.com 
 </pre> 

 <pre><code <pre class="ruby"> 
 class EmailAddress < ActiveRecord::Base 
   include Redmine::SafeAttributes 

   EMAIL_REGEXP = /\A([^@\s]+)@((?:[-a-z0-9]+\.)+(?:(?:xn--[-a-z0-9]+)|(?:[a-z]{2,})))\z/i 


 </pre> 

 </code></pre> 

 May be better to use @URI::MailTo::EMAIL_REGEXP@ URI::MailTo::EMAIL_REGEXP instead.

Back