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:
parent
4012eb7f9a
commit
0d597c1771
1 changed files with 1 additions and 0 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue