From: Andy Allan Date: Wed, 18 Mar 2020 13:33:30 +0000 (+0100) Subject: Remove unnecessary h() calls on model attributes X-Git-Tag: live~2803^2 X-Git-Url: https://git.openstreetmap.org./rails.git/commitdiff_plain/b8c1bbb4f8d9bacaa7d76b38a974f7f6042523ad Remove unnecessary h() calls on model attributes These were necessary in the rails 2.x era, but not now. --- diff --git a/app/views/browse/_common_details.html.erb b/app/views/browse/_common_details.html.erb index 1c8f1c5da..669e0fe6d 100644 --- a/app/views/browse/_common_details.html.erb +++ b/app/views/browse/_common_details.html.erb @@ -1,6 +1,6 @@

<% if common_details.changeset.tags['comment'].present? %> - <%= linkify(h(common_details.changeset.tags["comment"])) %> + <%= linkify(common_details.changeset.tags["comment"]) %> <% else %> <%= t "browse.no_comment" %> <% end %> @@ -15,7 +15,7 @@
<%= t "browse.version" %> - #<%= h(common_details.version) %> + #<%= common_details.version %> · <%= t "browse.in_changeset" %> #<%= link_to common_details.changeset_id, :action => :changeset, :id => common_details.changeset_id %> diff --git a/app/views/browse/_containing_relation.html.erb b/app/views/browse/_containing_relation.html.erb index ba05c1fe4..06220a97d 100644 --- a/app/views/browse/_containing_relation.html.erb +++ b/app/views/browse/_containing_relation.html.erb @@ -1,7 +1,7 @@ -
  • <%= linked_name = link_to h(printable_name(containing_relation.relation)), :action => "relation", :id => containing_relation.relation.id.to_s +
  • <%= linked_name = link_to printable_name(containing_relation.relation), :action => "relation", :id => containing_relation.relation.id.to_s if containing_relation.member_role.blank? t ".entry_html", :relation_name => linked_name else - t ".entry_role_html", :relation_name => linked_name, :relation_role => h(containing_relation.member_role) + t ".entry_role_html", :relation_name => linked_name, :relation_role => containing_relation.member_role end %>
  • diff --git a/app/views/browse/_relation_member.html.erb b/app/views/browse/_relation_member.html.erb index fe0f36357..51b2bb3e6 100644 --- a/app/views/browse/_relation_member.html.erb +++ b/app/views/browse/_relation_member.html.erb @@ -5,6 +5,6 @@ <%= if relation_member.member_role.blank? t ".entry_html", :type => type_str, :name => linked_name else - t ".entry_role_html", :type => type_str, :name => linked_name, :role => h(relation_member.member_role) + t ".entry_role_html", :type => type_str, :name => linked_name, :role => relation_member.member_role end %> diff --git a/app/views/browse/changeset.html.erb b/app/views/browse/changeset.html.erb index 9b68a03e7..3c41dd83f 100644 --- a/app/views/browse/changeset.html.erb +++ b/app/views/browse/changeset.html.erb @@ -6,7 +6,7 @@

    -
    <%= linkify(h(@changeset.tags["comment"].to_s.presence || t("browse.no_comment"))) %>
    +
    <%= linkify(@changeset.tags["comment"].to_s.presence || t("browse.no_comment")) %>
    <%= changeset_details(@changeset) %>
    <%= render :partial => "tag_details", :object => @changeset.tags.except("comment") %> @@ -38,7 +38,7 @@ <%= t(".commented_by", :when => friendly_date_ago(comment.created_at), :exact_time => l(comment.created_at), - :user => link_to(h(comment.author.display_name), user_path(comment.author))).html_safe %> + :user => link_to(comment.author.display_name, user_path(comment.author))).html_safe %> <% if current_user and current_user.moderator? %> — <%= t("javascripts.changesets.show.hide_comment") %> <% end %> @@ -51,7 +51,7 @@ <%= t(".hidden_commented_by", :when => friendly_date_ago(comment.created_at), :exact_time => l(comment.created_at), - :user => link_to(h(comment.author.display_name), user_path(comment.author))).html_safe %> + :user => link_to(comment.author.display_name, user_path(comment.author))).html_safe %> — <%= t("javascripts.changesets.show.unhide_comment") %> <%= comment.body.to_html %> diff --git a/app/views/changesets/index.atom.builder b/app/views/changesets/index.atom.builder index b1fbd6992..2bbae2cc2 100644 --- a/app/views/changesets/index.atom.builder +++ b/app/views/changesets/index.atom.builder @@ -24,9 +24,9 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, :type => "application/osmChange+xml" if !changeset.tags.empty? && changeset.tags.key?("comment") - entry.title t("browse.changeset.feed.title_comment", :id => h(changeset.id), :comment => h(changeset.tags["comment"])), :type => "html" + entry.title t("browse.changeset.feed.title_comment", :id => changeset.id, :comment => changeset.tags["comment"]), :type => "html" else - entry.title t("browse.changeset.feed.title", :id => h(changeset.id)) + entry.title t("browse.changeset.feed.title", :id => changeset.id) end if changeset.user.data_public? @@ -51,7 +51,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, table.tr do |tr| tr.th t("browse.changeset.belongs_to") tr.td do |td| - td.a h(changeset.user.display_name), :href => user_url(changeset.user, :only_path => false) + td.a changeset.user.display_name, :href => user_url(changeset.user, :only_path => false) end end end @@ -62,7 +62,7 @@ atom_feed(:language => I18n.locale, :schema_date => 2009, td.table :cellpadding => "0" do |tag_table| changeset.tags.sort.each do |tag| tag_table.tr do |tag_tr| - tag_tr.td << "#{h(tag[0])} = #{linkify(h(tag[1]))}" + tag_tr.td << "#{tag[0]} = #{linkify(tag[1])}" end end end diff --git a/app/views/diary_entries/_diary_comment.html.erb b/app/views/diary_entries/_diary_comment.html.erb index 3893072ad..db4847826 100644 --- a/app/views/diary_entries/_diary_comment.html.erb +++ b/app/views/diary_entries/_diary_comment.html.erb @@ -1,6 +1,6 @@
    "> <%= user_thumbnail diary_comment.user %> -

    <%= t(".comment_from_html", :link_user => (link_to h(diary_comment.user.display_name), user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %> +

    <%= t(".comment_from_html", :link_user => (link_to diary_comment.user.display_name, user_path(diary_comment.user)), :comment_created_at => link_to(l(diary_comment.created_at, :format => :friendly), :anchor => "comment#{diary_comment.id}")) %> <% if current_user and diary_comment.user.id != current_user.id %> | <%= report_link(t(".report"), diary_comment) %> <% end %> diff --git a/app/views/diary_entries/_diary_entry.html.erb b/app/views/diary_entries/_diary_entry.html.erb index 5508817a8..b0c464718 100644 --- a/app/views/diary_entries/_diary_entry.html.erb +++ b/app/views/diary_entries/_diary_entry.html.erb @@ -4,10 +4,10 @@ <%= user_thumbnail diary_entry.user %> <% end %> -

    <%= link_to h(diary_entry.title), diary_entry_path(diary_entry.user, diary_entry) %>

    +

    <%= link_to diary_entry.title, diary_entry_path(diary_entry.user, diary_entry) %>

    - <%= t(".posted_by_html", :link_user => (link_to h(diary_entry.user.display_name), user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to diary_entry.language.name, :controller => "diary_entries", :action => "index", :display_name => nil, :language => diary_entry.language_code)) %> + <%= t(".posted_by_html", :link_user => (link_to diary_entry.user.display_name, user_path(diary_entry.user)), :created => l(diary_entry.created_at, :format => :blog), :language_link => (link_to diary_entry.language.name, :controller => "diary_entries", :action => "index", :display_name => nil, :language => diary_entry.language_code)) %>
    diff --git a/app/views/diary_entries/index.html.erb b/app/views/diary_entries/index.html.erb index a599aea17..32a4e1e0f 100644 --- a/app/views/diary_entries/index.html.erb +++ b/app/views/diary_entries/index.html.erb @@ -3,7 +3,7 @@ <% if @user %> <%= user_image @user %> <% end %> -

    <%= h(@title) %>

    +

    <%= @title %>