diff --git a/CHANGELOG.md b/CHANGELOG.md index c15546608..1c15cbe3c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,24 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/). ### Removed +## 2.5.1 + +### Added +- Allow customizing instance languages + +### Fixed +- Security: uploading HTTP endpoint can no longer create directories in the upload dir (internal APIs, like backup, still can do it.) +- ~ character in urls in Markdown posts are handled properly +- Exiftool upload filter will now ignore SVG files +- Fix `block_from_stranger` setting +- Fix rel="me" +- Docker images will now run properly +- Fix inproper content being cached in report content +- Notification filter on object content will not operate on the ones that inherently have no content +- ZWNJ and double dots in links are parsed properly for Plain-text posts +- OTP releases will work on systems with a newer libcrypt +- Errors when running Exiftool.ReadDescription filter will not be filled into the image description + ## 2.5.0 - 2022-12-23 ### Removed diff --git a/lib/pleroma/web/activity_pub/activity_pub.ex b/lib/pleroma/web/activity_pub/activity_pub.ex index b9206b4da..1ab2db94a 100644 --- a/lib/pleroma/web/activity_pub/activity_pub.ex +++ b/lib/pleroma/web/activity_pub/activity_pub.ex @@ -1453,13 +1453,22 @@ defmodule Pleroma.Web.ActivityPub.ActivityPub do @spec upload(Upload.source(), keyword()) :: {:ok, Object.t()} | {:error, any()} def upload(file, opts \\ []) do - with {:ok, data} <- Upload.store(file, opts) do + with {:ok, data} <- Upload.store(sanitize_upload_file(file), opts) do obj_data = Maps.put_if_present(data, "actor", opts[:actor]) Repo.insert(%Object{data: obj_data}) end end + defp sanitize_upload_file(%Plug.Upload{filename: filename} = upload) when is_binary(filename) do + %Plug.Upload{ + upload + | filename: Path.basename(filename) + } + end + + defp sanitize_upload_file(upload), do: upload + @spec get_actor_url(any()) :: binary() | nil defp get_actor_url(url) when is_binary(url), do: url defp get_actor_url(%{"href" => href}) when is_binary(href), do: href diff --git a/mix.exs b/mix.exs index 58493a10e..8aa18d5ee 100644 --- a/mix.exs +++ b/mix.exs @@ -4,7 +4,7 @@ defmodule Pleroma.Mixfile do def project do [ app: :pleroma, - version: version("2.5.50"), + version: version("2.5.51"), elixir: "~> 1.11", elixirc_paths: elixirc_paths(Mix.env()), compilers: [:phoenix, :gettext] ++ Mix.compilers(), diff --git a/priv/static/index.html b/priv/static/index.html index 5593fe142..7dd5d0b78 100644 --- a/priv/static/index.html +++ b/priv/static/index.html @@ -1 +1 @@ -