Prevent XML parser from loading external entities
This commit is contained in:
parent
ff2f3862ab
commit
fc10e07ffb
1 changed files with 4 additions and 1 deletions
|
@ -29,7 +29,10 @@ def parse_document(text) do
|
||||||
{doc, _rest} =
|
{doc, _rest} =
|
||||||
text
|
text
|
||||||
|> :binary.bin_to_list()
|
|> :binary.bin_to_list()
|
||||||
|> :xmerl_scan.string(quiet: true)
|
|> :xmerl_scan.string(
|
||||||
|
quiet: true,
|
||||||
|
fetch_fun: fn _, _ -> raise "Resolving external entities not supported" end
|
||||||
|
)
|
||||||
|
|
||||||
{:ok, doc}
|
{:ok, doc}
|
||||||
rescue
|
rescue
|
||||||
|
|
Loading…
Reference in a new issue