Files
nairobi/app/views/shared/_banner.html.erb
Javi Martín e470ea1cc1 Avoid JavaScript execution in banner URLs
Using `sanitize` we make sure the `href` attribute does not execute any
dangerous code. The possibility of a banner pointing to a dangerous URL
was very reduced, though, since only administrators can edit this
attribute.
2019-11-13 19:52:15 +01:00

5 lines
191 B
Plaintext

<% banner ||= @banners.sample %>
<div class="banner" style="background-color:<%= banner.background_color %>;">
<%= sanitize banner_target_link(banner), attributes: %w[href style] %>
</div>