aboutsummaryrefslogtreecommitdiffstats
path: root/app/models
diff options
context:
space:
mode:
Diffstat (limited to 'app/models')
-rw-r--r--app/models/comment.rb2
-rw-r--r--app/models/incoming_message.rb2
-rw-r--r--app/models/outgoing_message.rb2
-rw-r--r--app/models/public_body.rb2
4 files changed, 4 insertions, 4 deletions
diff --git a/app/models/comment.rb b/app/models/comment.rb
index 5507910e2..bcd1efca8 100644
--- a/app/models/comment.rb
+++ b/app/models/comment.rb
@@ -68,7 +68,7 @@ class Comment < ActiveRecord::Base
text = CGI.escapeHTML(text)
text = MySociety::Format.make_clickable(text, :contract => 1)
text = text.gsub(/\n/, '<br>')
- return text
+ return text.html_safe
end
# When posting a new comment, use this to check user hasn't double submitted.
diff --git a/app/models/incoming_message.rb b/app/models/incoming_message.rb
index 7729e04f4..ee8b92f11 100644
--- a/app/models/incoming_message.rb
+++ b/app/models/incoming_message.rb
@@ -694,7 +694,7 @@ class IncomingMessage < ActiveRecord::Base
text = text.gsub(/\n/, '<br>')
text = text.gsub(/(?:<br>\s*){2,}/, '<br><br>') # remove excess linebreaks that unnecessarily space it out
- return text
+ return text.html_safe
end
diff --git a/app/models/outgoing_message.rb b/app/models/outgoing_message.rb
index eb9f1bd5e..23b5c904b 100644
--- a/app/models/outgoing_message.rb
+++ b/app/models/outgoing_message.rb
@@ -247,7 +247,7 @@ class OutgoingMessage < ActiveRecord::Base
text = MySociety::Format.make_clickable(text, :contract => 1)
text.gsub!(/\[(email address|mobile number)\]/, '[<a href="/help/officers#mobiles">\1</a>]')
text = text.gsub(/\n/, '<br>')
- return text
+ return text.html_safe
end
def fully_destroy
diff --git a/app/models/public_body.rb b/app/models/public_body.rb
index 9bd80a90a..b48c57228 100644
--- a/app/models/public_body.rb
+++ b/app/models/public_body.rb
@@ -298,7 +298,7 @@ class PublicBody < ActiveRecord::Base
ret = ret + " and "
end
ret = ret + types[-1]
- return ret
+ return ret.html_safe
else
return _("A public authority")
end