Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
escape team name in CRM (#5321)
Cenk Kücüke6f6673dca14
diff --git a/lib/plausible/auth/user_admin.ex b/lib/plausible/auth/user_admin.exindex 82437178de..c71b5e65f0 100644--- a/lib/plausible/auth/user_admin.ex+++ b/lib/plausible/auth/user_admin.ex@@ -62,7 +62,7 @@ defmodule Plausible.Auth.UserAdmin doteams|> Enum.map_join("<br>\n", fn team ->"""- <a href="/crm/teams/team/#{team.id}">#{team.name}</a>+ <a href="/crm/teams/team/#{team.id}">#{html_escape(team.name)}</a>"""end)end@@ -72,4 +72,10 @@ defmodule Plausible.Auth.UserAdmin dodefp format_date(date) doCalendar.strftime(date, "%b %-d, %Y")end++ def html_escape(string) do+ string+ |> Phoenix.HTML.html_escape()+ |> Phoenix.HTML.safe_to_string()+ endenddiff --git a/lib/plausible_web/controllers/admin_controller.ex b/lib/plausible_web/controllers/admin_controller.exindex 01b353ac66..2ae12033ef 100644--- a/lib/plausible_web/controllers/admin_controller.ex+++ b/lib/plausible_web/controllers/admin_controller.ex@@ -99,10 +99,10 @@ defmodule PlausibleWeb.AdminController doselect:fragment("""- case when ? = false then- string_agg(concat(?, ' (', ?, ')'), ',')- else- concat(?, ' [', string_agg(concat(?, ' (', ?, ')'), ','), ']')+ case when ? = false then+ string_agg(concat(?, ' (', ?, ')'), ',')+ else+ concat(?, ' [', string_agg(concat(?, ' (', ?, ')'), ','), ']')end""",t.setup_complete,@@ -155,9 +155,9 @@ defmodule PlausibleWeb.AdminController doselect: [fragment("""- case when ? = false then+ case when ? = false thenconcat(string_agg(concat(?, ' (', ?, ')'), ','), ' - ', ?)- else+ elseconcat(concat(?, ' [', string_agg(concat(?, ' (', ?, ')'), ','), ']'), ' - ', ?)end""",@@ -187,7 +187,7 @@ defmodule PlausibleWeb.AdminController dodefp usage_and_limits_html(team, usage, limits, embed?) docontent = """<ul>- <li>Team: <b>#{team.name}</b></li>+ <li>Team: <b>#{html_escape(team.name)}</b></li><li>Subscription plan: #{Teams.TeamAdmin.subscription_plan(team)}</li><li>Subscription status: #{Teams.TeamAdmin.subscription_status(team)}</li><li>Grace period: #{Teams.TeamAdmin.grace_period_status(team)}</li>