Skip to content

Commit

Permalink
Fix not so safe input (plausible#4263)
Browse files Browse the repository at this point in the history
  • Loading branch information
cnkk authored Jun 24, 2024
1 parent a8b9505 commit c59bdd2
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/plausible/site/admin.ex
Original file line number Diff line number Diff line change
Expand Up @@ -164,11 +164,14 @@ defmodule Plausible.SiteAdmin do
owner = site.owner

if owner do
escaped_name = Phoenix.HTML.html_escape(owner.name) |> Phoenix.HTML.safe_to_string()
escaped_email = Phoenix.HTML.html_escape(owner.email) |> Phoenix.HTML.safe_to_string()

{:safe,
"""
<a href="/crm/auth/user/#{owner.id}">#{owner.name}</a>
<a href="/crm/auth/user/#{owner.id}">#{escaped_name}</a>
<br/><br/>
#{owner.email}
#{escaped_email}
"""}
end
end
Expand Down

0 comments on commit c59bdd2

Please sign in to comment.