diff options
Diffstat (limited to 'lib/pleroma/upload.ex')
-rw-r--r-- | lib/pleroma/upload.ex | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/pleroma/upload.ex b/lib/pleroma/upload.ex index 0b1bdeec4..0a19e737b 100644 --- a/lib/pleroma/upload.ex +++ b/lib/pleroma/upload.ex @@ -34,8 +34,9 @@ defmodule Pleroma.Upload do require Logger @type source :: - Plug.Upload.t() | data_uri_string :: - String.t() | {:from_local, name :: String.t(), id :: String.t(), path :: String.t()} + Plug.Upload.t() + | (data_uri_string :: String.t()) + | {:from_local, name :: String.t(), id :: String.t(), path :: String.t()} @type option :: {:type, :avatar | :banner | :background} @@ -215,6 +216,12 @@ defmodule Pleroma.Upload do end defp url_from_spec(base_url, {:file, path}) do + path = + path + |> URI.encode() + |> String.replace("?", "%3F") + |> String.replace(":", "%3A") + [base_url, "media", path] |> Path.join() end |