diff options
author | lain <lain@soykaf.club> | 2025-03-01 16:41:38 +0000 |
---|---|---|
committer | lain <lain@soykaf.club> | 2025-03-01 16:41:38 +0000 |
commit | af6d5470d29f294e9b356da36cccbcaf85379f78 (patch) | |
tree | 81eb0ba210f674eb0f6f41cde9b692a27ea96ca0 /lib/pleroma/frontend.ex | |
parent | fe3e61f6ece0335627f675e04a93917e6c613c6c (diff) | |
parent | cd5f018206c991628ff1530095bb71cf941e7a8b (diff) | |
download | pleroma-af6d5470d29f294e9b356da36cccbcaf85379f78.tar.gz pleroma-af6d5470d29f294e9b356da36cccbcaf85379f78.zip |
Merge branch 'release/2.9.0' into 'stable'
Release/2.9.0
See merge request pleroma/pleroma!4331
Diffstat (limited to 'lib/pleroma/frontend.ex')
-rw-r--r-- | lib/pleroma/frontend.ex | 22 |
1 files changed, 5 insertions, 17 deletions
diff --git a/lib/pleroma/frontend.ex b/lib/pleroma/frontend.ex index a4f427ae5..fe7f525ea 100644 --- a/lib/pleroma/frontend.ex +++ b/lib/pleroma/frontend.ex @@ -65,24 +65,12 @@ defmodule Pleroma.Frontend do end def unzip(zip, dest) do - with {:ok, unzipped} <- :zip.unzip(zip, [:memory]) do - File.rm_rf!(dest) - File.mkdir_p!(dest) - - Enum.each(unzipped, fn {filename, data} -> - path = filename - - new_file_path = Path.join(dest, path) - - path - |> Path.dirname() - |> then(&Path.join(dest, &1)) - |> File.mkdir_p!() + File.rm_rf!(dest) + File.mkdir_p!(dest) - if not File.dir?(new_file_path) do - File.write!(new_file_path, data) - end - end) + case Pleroma.SafeZip.unzip_data(zip, dest) do + {:ok, _} -> :ok + error -> error end end |