Add rel=nofollow to links in tags. Closes #2555.

This commit is contained in:
Tom Hughes 2009-12-14 09:09:32 +00:00
parent 01c7470805
commit d963aa30b7
4 changed files with 19 additions and 17 deletions

View file

@ -1,6 +1,10 @@
module ApplicationHelper module ApplicationHelper
def htmlize(text) def htmlize(text)
return auto_link(sanitize(simple_format(text)), :link => :urls, :html => { :rel => "nofollow" }) return linkify(sanitize(simple_format(text)))
end
def linkify(text)
return auto_link(text, :link => :urls, :html => { :rel => "nofollow" })
end end
def html_escape_unicode(text) def html_escape_unicode(text)

View file

@ -23,7 +23,7 @@
<% if common_details.changeset.tags['comment'] %> <% if common_details.changeset.tags['comment'] %>
<tr> <tr>
<th><%= t 'browse.common_details.changeset_comment' %></th> <th><%= t 'browse.common_details.changeset_comment' %></th>
<td><%= auto_link(h(common_details.changeset.tags['comment'])) %></td> <td><%= linkify(h(common_details.changeset.tags['comment'])) %></td>
</tr> </tr>
<% end %> <% end %>

View file

@ -1,3 +1,3 @@
<tr> <tr>
<td><%= h(tag[0]) %> = <%= auto_link(h(tag[1])) %></td> <td><%= h(tag[0]) %> = <%= linkify(h(tag[1])) %></td>
</tr> </tr>

View file

@ -28,7 +28,7 @@
<td class="<%= cl %> comment"> <td class="<%= cl %> comment">
<% if changeset.tags['comment'] %> <% if changeset.tags['comment'] %>
<%= auto_link(h(changeset.tags['comment'])) %> <%= linkify(h(changeset.tags['comment'])) %>
<% else %> <% else %>
<%= t'changeset.changeset.no_comment' %> <%= t'changeset.changeset.no_comment' %>
<% end %> <% end %>
@ -37,20 +37,18 @@
<td class="<%= cl %> area"> <td class="<%= cl %> area">
<% if changeset.min_lat.nil? %> <% if changeset.min_lat.nil? %>
<%= t'changeset.changeset.no_edits' %> <%= t'changeset.changeset.no_edits' %>
<% else <% else %>
minlon = changeset.min_lon/GeoRecord::SCALE.to_f <%
minlat = changeset.min_lat/GeoRecord::SCALE.to_f minlon = changeset.min_lon/GeoRecord::SCALE.to_f
maxlon = changeset.max_lon/GeoRecord::SCALE.to_f minlat = changeset.min_lat/GeoRecord::SCALE.to_f
maxlat = changeset.max_lat/GeoRecord::SCALE.to_f maxlon = changeset.max_lon/GeoRecord::SCALE.to_f
%> maxlat = changeset.max_lat/GeoRecord::SCALE.to_f
%>
<a href='/?minlon=<%= minlon %>&minlat=<%= minlat %>&maxlon=<%= maxlon %>&maxlat=<%= maxlat %>&box=yes' title='<%= t'changeset.changeset.show_area_box' %>'><%= format("%0.3f",minlon) -%>,<%= format("%0.3f",minlat) -%>,<%= format("%0.3f",maxlon) -%>,<%= format("%0.3f",maxlat) -%></a> <a href='/?minlon=<%= minlon %>&minlat=<%= minlat %>&maxlon=<%= maxlon %>&maxlat=<%= maxlat %>&box=yes' title='<%= t'changeset.changeset.show_area_box' %>'><%= format("%0.3f",minlon) -%>,<%= format("%0.3f",minlat) -%>,<%= format("%0.3f",maxlon) -%>,<%= format("%0.3f",maxlat) -%></a>
<!--<%=changeset.area%>--> <!--<%=changeset.area%>-->
<% if changeset.area > 1500000000000 %> <% if changeset.area > 1500000000000 %>
<%= t'changeset.changeset.big_area' %> <%= t'changeset.changeset.big_area' %>
<% <% end %>
end <% end %>
end
%>
</td> </td>
</tr> </tr>