diff options
author | Louise Crow <louise.crow@gmail.com> | 2013-09-19 15:59:10 +0100 |
---|---|---|
committer | Louise Crow <louise.crow@gmail.com> | 2013-09-19 15:59:10 +0100 |
commit | a971331328c4608941c3e7c1336d027802c1cdcc (patch) | |
tree | 28de4adf112bfeee1fc22603e46ec17434f37958 /app/models | |
parent | 93a81f161083f313d14bcc334c19c8871b4e54ca (diff) |
Handle salutations with regexp special characters.
Fixes #1104.
Diffstat (limited to 'app/models')
-rw-r--r-- | app/models/outgoing_message.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index e89c11141..e2ee696c5 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -271,7 +271,7 @@ class OutgoingMessage < ActiveRecord::Base end def format_of_body - if self.body.empty? || self.body =~ /\A#{get_salutation}\s+#{get_signoff}/ || self.body =~ /#{get_internal_review_insert_here_note}/ + if self.body.empty? || self.body =~ /\A#{Regexp.escape(get_salutation)}\s+#{Regexp.escape(get_signoff)}/ || self.body =~ /#{Regexp.escape(get_internal_review_insert_here_note)}/ if self.message_type == 'followup' if self.what_doing == 'internal_review' errors.add(:body, _("Please give details explaining why you want a review")) |