aboutsummaryrefslogtreecommitdiffstats
path: root/app/models/user.rb
diff options
context:
space:
mode:
Diffstat (limited to 'app/models/user.rb')
-rw-r--r--app/models/user.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/app/models/user.rb b/app/models/user.rb
index 306d6ad4a..9da4ad743 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -107,8 +107,11 @@ class User < ActiveRecord::Base
end
if self.public_banned?
# Use interpolation to return a string rather than a SafeBuffer so that
- # gsub can be called on it until we upgrade to Rails 3.2
- name = "#{_("{{user_name}} (Account suspended)", :user_name=> name)}"
+ # gsub can be called on it until we upgrade to Rails 3.2. The name returned
+ # is not marked as HTML safe so will be escaped automatically in views. We
+ # do this in two steps so the string still gets picked up for translation
+ name = _("{{user_name}} (Account suspended)", :user_name=> name.html_safe)
+ name = "#{name}"
end
name
end