Sign in through GitHub

Please read for an updated status on RailsCasts:

Learn more or hide this

Daniel Weller's Profile

GitHub User: danweller18

Site: http://rubyonrailshelp.wordpress.com/

Comments by Daniel Weller

Avatar

I get an issue when I include validates_format_of :email, :with => /^[-a-z0-9_+\.]+\@([-a-z0-9]+\.)+[a-z0-9]{2,4}$/i in app/models/message.rb. If I replace it with /\A([\w\.%\+\-]+)@([\w\-]+\.)+([\w]{2,})\z/i (found at Contact us functionality in Rails 3 - answer from JJD) it seems to work.

The error I receive says "The provided regular expression is using multiline anchors (^ or $), which may present a security risk. Did you mean to use \A and \z, or forgot to add the :multiline => true option?"

Note* I am using Rails 4 - not sure if it makes a difference. Does anyone else have this problem?