Revision b6ebaea1
Added by Daniel Lobato Garcia about 8 years ago
app/models/user.rb | ||
---|---|---|
|
||
validates :mail, :format => { :with => /\A(([\w!#\$%&\'\*\+\-\/=\?\^`\{\|\}~]+((\.\"[\w!#\$%&\'\*\+\-\/=\?\^`\{\|\}~\"\(\),:;<>@\[\\\] ]+(\.[\w!#\$%&\'\*\+\-\/=\?\^`\{\|\}~\"\(\),:;<>@\[\\\] ]+)*\")*\.[\w!#\$%&\'\*\+\-\/=\?\^`\{\|\}~]+)*)|(\"[\w !#\$%&\'\*\+\-\/=\?\^`\{\|\}~\"\(\),:;<>@\[\\\] ]+(\.[\w !#\$%&\'\*\+\-\/=\?\^`\{\|\}~\"\(\),:;<>@\[\\\] ]+)*\"))
|
||
@[a-z0-9]+((\.[a-z0-9]+)*|(\-[a-z0-9]+)*)*\z/ix },
|
||
:length => { :maximum => 60 },
|
||
:length => { :maximum => 254 },
|
||
:allow_blank => true
|
||
validates :mail, :presence => true, :on => :update,
|
||
:if => Proc.new { |u| !AuthSourceHidden.where(:id => u.auth_source_id).any? && u.mail_was.present? }
|
Also available in: Unified diff
Fixes #9584 - User email address length can be longer than 60
As far as I know, there's no need for this artificial limitation.