Fixed MailHandler broken by I18n fallback added in r4679.

git-svn-id: svn+ssh://rubyforge.org/var/svn/redmine/trunk@4682 e93f8b46-1217-0410-a6f0-8f06a7374b81
This commit is contained in:
Jean-Philippe Lang 2011-01-10 19:57:41 +00:00
parent a9c4ec31ca
commit 7b7577c747
1 changed files with 2 additions and 2 deletions

View File

@ -235,8 +235,8 @@ class MailHandler < ActionMailer::Base
def extract_keyword!(text, attr, format=nil) def extract_keyword!(text, attr, format=nil)
keys = [attr.to_s.humanize] keys = [attr.to_s.humanize]
if attr.is_a?(Symbol) if attr.is_a?(Symbol)
keys << l("field_#{attr}", :default => '', :locale => user.language) if user keys << l("field_#{attr}", :default => '', :locale => user.language) if user && user.language.present?
keys << l("field_#{attr}", :default => '', :locale => Setting.default_language) keys << l("field_#{attr}", :default => '', :locale => Setting.default_language) if Setting.default_language.present?
end end
keys.reject! {|k| k.blank?} keys.reject! {|k| k.blank?}
keys.collect! {|k| Regexp.escape(k)} keys.collect! {|k| Regexp.escape(k)}