Merge branch 'master' into openstreetbugs

This commit is contained in:
Tom Hughes 2010-07-28 21:30:55 +01:00
commit 52395b3cdf
63 changed files with 288 additions and 225 deletions

View file

@ -48,7 +48,7 @@ class Notifier < ActionMailer::Base
def message_notification(message)
common_headers message.recipient
from_header message.sender.display_name, "m", message.id, message.digest
subject message.title
subject I18n.t('notifier.message_notification.subject_header', :subject => message.title, :locale => locale)
body :to_user => message.recipient.display_name,
:from_user => message.sender.display_name,
:body => message.body,

View file

@ -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