mirror of
https://git.pleroma.social/pleroma/pleroma.git
synced 2025-01-05 14:58:40 +00:00
B Preload: Make sure that the preloaded json is html safe
This commit is contained in:
parent
e8d3525665
commit
cbc5b8cebd
1 changed files with 2 additions and 2 deletions
|
@ -11,7 +11,7 @@ defmodule Pleroma.Web.Preload do
|
||||||
terms =
|
terms =
|
||||||
params
|
params
|
||||||
|> parser.generate_terms()
|
|> parser.generate_terms()
|
||||||
|> Enum.map(fn {k, v} -> {k, Base.encode64(Jason.encode!(v))} end)
|
|> Enum.map(fn {k, v} -> {k, Base.encode64(Jason.encode!(v, escape: :html_safe))} end)
|
||||||
|> Enum.into(%{})
|
|> Enum.into(%{})
|
||||||
|
|
||||||
Map.merge(acc, terms)
|
Map.merge(acc, terms)
|
||||||
|
@ -19,7 +19,7 @@ defmodule Pleroma.Web.Preload do
|
||||||
|
|
||||||
rendered_html =
|
rendered_html =
|
||||||
preload_data
|
preload_data
|
||||||
|> Jason.encode!()
|
|> Jason.encode!(escape: :html_safe)
|
||||||
|> build_script_tag()
|
|> build_script_tag()
|
||||||
|> HTML.safe_to_string()
|
|> HTML.safe_to_string()
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue