Don't allow [/;.,?] to be used in display names, as those are used as

separator characters by rails when routing, which means a display name
containing them will not work as part of a URL.
This commit is contained in:
Tom Hughes 2007-06-11 08:43:47 +00:00
parent 4012eb7f9a
commit 0d597c1771

View file

@ -13,6 +13,7 @@ class User < ActiveRecord::Base
validates_length_of :pass_crypt, :minimum => 8
validates_length_of :display_name, :minimum => 3, :allow_nil => true
validates_format_of :email, :with => /^([^@\s]+)@((?:[-a-z0-9]+\.)+[a-z]{2,})$/i
validates_format_of :display_name, :with => /^[^\/;.,?]*$/
before_save :encrypt_password