diff --git a/app/models/topic.rb b/app/models/topic.rb index 9a0e93d942e..19a3da5902e 100644 --- a/app/models/topic.rb +++ b/app/models/topic.rb @@ -249,13 +249,7 @@ class Topic < ActiveRecord::Base end def fancy_title - sanitized_title = title.gsub(/['&\"<>]/, { - "'" => ''', - '&' => '&', - '"' => '"', - '<' => '<', - '>' => '>', - }) + sanitized_title = ERB::Util.html_escape(title) return unless sanitized_title return sanitized_title unless SiteSetting.title_fancy_entities?