Merge branch 'master' into overpass
[rails.git] / app / helpers / title_helper.rb
index 8cacdf2085a7dbf425406c4c33475ea12ec618e5..a1a2125a173f81a72f2b53dcdccecdb3b9322e3f 100644 (file)
@@ -1,7 +1,11 @@
+require 'htmlentities'
+
 module TitleHelper
+  @@coder = HTMLEntities.new
+
   def set_title(title = false)
     if title
-      @title = title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c")
+      @title = @@coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
       response.headers["X-Page-Title"] = t('layouts.project_name.title') + ' | ' + @title
     else
       @title = title