openstreetmap-website/app/helpers/title_helper.rb
Tom Hughes aa00e6b81e Decode entities in the title
They will get reencoded (if necessary) when they are output. Fixes #764.
2014-06-18 09:29:17 +01:00

15 lines
414 B
Ruby

require 'htmlentities'
module TitleHelper
@@coder = HTMLEntities.new
def set_title(title = false)
if title
@title = @@coder.decode(title.gsub("<bdi>", "\u202a").gsub("</bdi>", "\u202c"))
response.headers["X-Page-Title"] = t('layouts.project_name.title') + ' | ' + @title
else
@title = title
response.headers["X-Page-Title"] = t('layouts.project_name.title')
end
end
end