mirror of
https://github.com/redmine/redmine.git
synced 2025-11-04 20:35:57 +01:00
Use match? instead of =~ when MatchData is not used (#34150).
Patch by Go MAEDA. git-svn-id: http://svn.redmine.org/redmine/trunk@20168 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
@@ -186,7 +186,7 @@ class Setting < ActiveRecord::Base
|
||||
if settings.key?(:mail_from)
|
||||
begin
|
||||
mail_from = Mail::Address.new(settings[:mail_from])
|
||||
raise unless mail_from.address =~ EmailAddress::EMAIL_REGEXP
|
||||
raise unless EmailAddress::EMAIL_REGEXP.match?(mail_from.address)
|
||||
rescue
|
||||
messages << [:mail_from, l('activerecord.errors.messages.invalid')]
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user