Reject leading and trailing whitespace in display names
This commit is contained in:
parent
98d73aead1
commit
b4a22eee71
1 changed files with 2 additions and 0 deletions
|
@ -28,6 +28,8 @@ class User < ActiveRecord::Base
|
|||
validates_email_format_of :email
|
||||
validates_email_format_of :new_email, :allow_blank => true
|
||||
validates_format_of :display_name, :with => /^[^\/;.,?]*$/
|
||||
validates_format_of :display_name, :with => /^\S/, :message => "has leading whitespace"
|
||||
validates_format_of :display_name, :with => /\S$/, :message => "has trailing whitespace"
|
||||
validates_numericality_of :home_lat, :allow_nil => true
|
||||
validates_numericality_of :home_lon, :allow_nil => true
|
||||
validates_numericality_of :home_zoom, :only_integer => true, :allow_nil => true
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue