Validate URLs against supply-chain attacks

Unfortunately validates_url gem doesn't support mailto or xmpp urls,
so we need to write our own validation.
This commit is contained in:
Andy Allan 2022-11-02 18:21:00 +00:00
parent 7e5cbe87ed
commit af6fec502a
3 changed files with 45 additions and 1 deletions

View file

@ -9,7 +9,13 @@
<p><%= t ".local_chapters.list_text" %></p>
<ul>
<% @local_chapters.each do |chapter| %>
<li><a href="<%= chapter.url %>"><%= t "osm_community_index.communities.#{chapter.id}.name" %></a></li>
<li>
<% if chapter.url %>
<a href="<%= chapter.url %>"><%= t "osm_community_index.communities.#{chapter.id}.name" %></a>
<% else %>
<%= t "osm_community_index.communities.#{chapter.id}.name" %>
<% end %>
</li>
<% end %>
</ul>