From bee10eab5ebf6aa4d50238afd3d9c37a014dd745 Mon Sep 17 00:00:00 2001 From: Floatingghost Date: Sat, 26 Oct 2024 06:11:12 +0100 Subject: [PATCH] correct minor zip behaviour --- lib/pleroma/emoji/pack.ex | 2 +- test/pleroma/emoji/pack_test.exs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/pleroma/emoji/pack.ex b/lib/pleroma/emoji/pack.ex index 142208854..e95320a07 100644 --- a/lib/pleroma/emoji/pack.ex +++ b/lib/pleroma/emoji/pack.ex @@ -125,7 +125,7 @@ def add_file(%Pack{} = pack, _, _, %Plug.Upload{content_type: "application/zip"} {:ok, _emoji_files} = :zip.unzip( to_charlist(file.path), - [{:file_list, Enum.map(emojies, & &1[:path])}, {:cwd, tmp_dir}] + [{:file_list, Enum.map(emojies, & &1[:path])}, {:cwd, to_charlist(tmp_dir)}] ) {_, updated_pack} = diff --git a/test/pleroma/emoji/pack_test.exs b/test/pleroma/emoji/pack_test.exs index f5d2e2eef..3843add13 100644 --- a/test/pleroma/emoji/pack_test.exs +++ b/test/pleroma/emoji/pack_test.exs @@ -64,7 +64,7 @@ test "returns error when zip file is bad", %{pack: pack} do path: Path.absname("test/instance_static/emoji/test_pack/blank.png") } - assert Pack.add_file(pack, nil, nil, file) == {:error, :einval} + assert Pack.add_file(pack, nil, nil, file) == {:error, :bad_eocd} end test "returns pack when zip file is empty", %{pack: pack} do