diff options
Diffstat (limited to 'app')
-rw-r--r-- | app/models/incoming_message.rb | 3 | ||||
-rw-r--r-- | app/models/outgoing_message.rb | 3 |
2 files changed, 4 insertions, 2 deletions
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb index 8903b8c01..2b4469856 100644 --- a/app/models/incoming_message.rb +++ b/app/models/incoming_message.rb @@ -19,7 +19,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: incoming_message.rb,v 1.202 2009-04-27 02:25:31 francis Exp $ +# $Id: incoming_message.rb,v 1.203 2009-05-09 07:46:59 tony Exp $ # TODO # Move some of the (e.g. quoting) functions here into rblib, as they feel @@ -908,6 +908,7 @@ class IncomingMessage < ActiveRecord::Base text = MySociety::Format.simplify_angle_bracketed_urls(text) text = CGI.escapeHTML(text) text = MySociety::Format.make_clickable(text, :contract => 1) + text.gsub!(/\[(email address|mobile number)\]/, '[<a href="/help/about#mobiles">\1</a>]') if collapse_quoted_sections text = text.gsub(/(\s*FOLDED_QUOTED_SECTION\s*)+/m, "FOLDED_QUOTED_SECTION") text.strip! diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb index 5d81e5361..116dc5059 100644 --- a/app/models/outgoing_message.rb +++ b/app/models/outgoing_message.rb @@ -22,7 +22,7 @@ # Copyright (c) 2007 UK Citizens Online Democracy. All rights reserved. # Email: francis@mysociety.org; WWW: http://www.mysociety.org/ # -# $Id: outgoing_message.rb,v 1.83 2009-04-13 09:18:48 tony Exp $ +# $Id: outgoing_message.rb,v 1.84 2009-05-09 07:46:59 tony Exp $ class OutgoingMessage < ActiveRecord::Base strip_attributes! @@ -215,6 +215,7 @@ class OutgoingMessage < ActiveRecord::Base text = MySociety::Format.wrap_email_body(text) # reparagraph and wrap it so is good preview of emails text = CGI.escapeHTML(text) text = MySociety::Format.make_clickable(text, :contract => 1) + text.gsub!(/\[(email address|mobile number)\]/, '[<a href="/help/about#mobiles">\1</a>]') text = text.gsub(/\n/, '<br>') return text end |