Do some basic escaping.
This commit is contained in:
parent
1af9c77736
commit
83c657afa5
3 changed files with 16 additions and 2 deletions
|
|
@ -11,7 +11,7 @@ defmodule Pleroma.Web.TwitterAPI.Utils do
|
|||
def add_attachments(text, attachments) do
|
||||
attachment_text = Enum.map(attachments, fn
|
||||
(%{"url" => [%{"href" => href} | _]}) ->
|
||||
"<a href='#{href}' class='attachment'>#{Path.basename(href)}</a>"
|
||||
"<a href=\"#{URI.encode(href)}\" class='attachment'>#{Path.basename(href)}</a>"
|
||||
_ -> ""
|
||||
end)
|
||||
Enum.join([text | attachment_text], "<br>\n")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue