Transmogrifier: Use validating regex for "mediaType"
This commit is contained in:
parent
8640d217b1
commit
7ec3469bea
|
@ -203,13 +203,13 @@ def fix_attachments(%{"attachment" => attachment} = object) when is_list(attachm
|
||||||
|
|
||||||
media_type =
|
media_type =
|
||||||
cond do
|
cond do
|
||||||
is_map(url) && MIME.extensions(url["mediaType"]) != [] ->
|
is_map(url) && url =~ Pleroma.Constants.mime_regex() ->
|
||||||
url["mediaType"]
|
url["mediaType"]
|
||||||
|
|
||||||
is_bitstring(data["mediaType"]) && MIME.extensions(data["mediaType"]) != [] ->
|
is_bitstring(data["mediaType"]) && data["mediaType"] =~ Pleroma.Constants.mime_regex() ->
|
||||||
data["mediaType"]
|
data["mediaType"]
|
||||||
|
|
||||||
is_bitstring(data["mimeType"]) && MIME.extensions(data["mimeType"]) != [] ->
|
is_bitstring(data["mimeType"]) && data["mimeType"] =~ Pleroma.Constants.mime_regex() ->
|
||||||
data["mimeType"]
|
data["mimeType"]
|
||||||
|
|
||||||
true ->
|
true ->
|
||||||
|
|
Loading…
Reference in New Issue