Skip to content
This repository was archived by the owner on Nov 8, 2022. It is now read-only.

Commit c0739c3

Browse files
committed
fix(xss): remove the escape logic
1 parent 2cd11a5 commit c0739c3

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

lib/helper/html.ex

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,8 @@ defmodule Helper.HTML do
3030
# end
3131
# end
3232

33-
defp escape_to_safe_string(v), do: v |> HTML.html_escape() |> HTML.safe_to_string()
33+
# defp escape_to_safe_string(v), do: v |> HTML.html_escape() |> HTML.safe_to_string()
34+
defp escape_to_safe_string(v), do: v
35+
36+
# defp escape_to_safe_string(v), do: v |> HTML.javascript_escape # HTML.html_escape() |> HTML.safe_to_string()
3437
end

test/support/assert_helper.ex

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ defmodule GroupherServer.Test.AssertHelper do
2424
def assert_v(:xss_string), do: "<script>alert(\"hello,world\")</script>"
2525

2626
def assert_v(:xss_safe_string),
27-
do: "&lt;script&gt;alert(&quot;hello,world&quot;)&lt;/script&gt;"
27+
# "&lt;script&gt;alert(&quot;hello,world&quot;)&lt;/script&gt;"
28+
do: "<script>alert(\"hello,world\")</script>"
2829

2930
def is_valid_kv?(obj, key, :list) when is_map(obj) do
3031
obj = map_key_stringify(obj)

0 commit comments

Comments
 (0)