From: Andy Allan Date: Sat, 29 Oct 2016 14:54:42 +0000 (+0200) Subject: Avoid double-escaping diary entry titles X-Git-Tag: live~3702^2 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/4a9aa0a12e3a9f4dbe19f17b3117c727b62a43b9?ds=sidebyside Avoid double-escaping diary entry titles The XML builder takes care of the escaping, and adding h() lead to double-escaped titles in the RSS feed. --- diff --git a/app/views/diary_entry/rss.rss.builder b/app/views/diary_entry/rss.rss.builder index 7adcb3b52..5e1dee762 100644 --- a/app/views/diary_entry/rss.rss.builder +++ b/app/views/diary_entry/rss.rss.builder @@ -17,7 +17,7 @@ xml.rss("version" => "2.0", @entries.each do |entry| xml.item do - xml.title h(entry.title) + xml.title entry.title xml.link url_for(:action => "view", :id => entry.id, :display_name => entry.user.display_name, :host => SERVER_URL) xml.guid url_for(:action => "view", :id => entry.id, :display_name => entry.user.display_name, :host => SERVER_URL) xml.description entry.body.to_html diff --git a/test/controllers/diary_entry_controller_test.rb b/test/controllers/diary_entry_controller_test.rb index 6e766460e..4a8451e89 100644 --- a/test/controllers/diary_entry_controller_test.rb +++ b/test/controllers/diary_entry_controller_test.rb @@ -563,6 +563,13 @@ class DiaryEntryControllerTest < ActionController::TestCase assert_response :not_found, "Should not be able to get a deleted users diary RSS" end + def test_rss_character_escaping + create(:diary_entry, :title => "