Explicitly trust Wikipedia's HTML

Closes #168
This commit is contained in:
Claudio Ortolina
2026-04-16 23:14:00 +01:00
parent 464e627a63
commit fbc548e903
@@ -295,7 +295,7 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
placement="left" placement="left"
> >
<div class="dark:prose-invert prose prose-sm"> <div class="dark:prose-invert prose prose-sm">
{Phoenix.HTML.raw(@biography.bio_html)} {render_bio(@biography)}
</div> </div>
<a <a
:if={@biography.url} :if={@biography.url}
@@ -735,4 +735,10 @@ defmodule MusicLibraryWeb.ArtistLive.Show do
wishlist: Enum.sort_by(wishlist, fn r -> r.release_date end, :desc) wishlist: Enum.sort_by(wishlist, fn r -> r.release_date end, :desc)
} }
end end
# Wikipedia returns sanitized HTML, so we can skip sanitization.
# sobelow_skip ["XSS.Raw"]
defp render_bio(biography) do
{Phoenix.HTML.raw(biography.bio_html)}
end
end end