[Bugfix] Properly escape NFO files (#168)

* Properly escaped NFO file contents

* Added an NFO backfill worker

* Added a try-catch to the backfill since I _really_ don't want failures to halt app boot
This commit is contained in:
Kieran
2024-04-06 11:48:28 -07:00
committed by GitHub
parent 24875eaeac
commit 81b49f55bf
7 changed files with 149 additions and 18 deletions
+17
View File
@@ -0,0 +1,17 @@
defmodule Pinchflat.Utils.XmlUtils do
@moduledoc """
Utility methods for working with XML documents
"""
@doc """
Escapes invalid XML characters in a string
Returns binary()
"""
def safe(value) do
value
|> to_string()
|> Phoenix.HTML.html_escape()
|> Phoenix.HTML.safe_to_string()
end
end