summaryrefslogtreecommitdiff
path: root/html.c
diff options
context:
space:
mode:
authorGravatar grunfink2025-05-29 13:12:43 +0200
committerGravatar grunfink2025-05-29 13:12:43 +0200
commit34d85b3e1bbda2e89191026b3815dd9b6f23afcb (patch)
tree631e216fb24ae3dd028ebb4043364de88c80d7df /html.c
parentAdded more checks. (diff)
downloadpenes-snac2-34d85b3e1bbda2e89191026b3815dd9b6f23afcb.tar.gz
penes-snac2-34d85b3e1bbda2e89191026b3815dd9b6f23afcb.tar.xz
penes-snac2-34d85b3e1bbda2e89191026b3815dd9b6f23afcb.zip
mastoapi: fixed uploaded images name collision.
Diffstat (limited to 'html.c')
-rw-r--r--html.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/html.c b/html.c
index 3d213a2..56dc2cc 100644
--- a/html.c
+++ b/html.c
@@ -4362,7 +4362,7 @@ int html_post_handler(const xs_dict *req, const char *q_path,
4362 xs_rnd_buf(rnd, sizeof(rnd)); 4362 xs_rnd_buf(rnd, sizeof(rnd));
4363 4363
4364 const char *ext = strrchr(fn, '.'); 4364 const char *ext = strrchr(fn, '.');
4365 xs *hash = xs_md5_hex(rnd, strlen(rnd)); 4365 xs *hash = xs_md5_hex(rnd, sizeof(rnd));
4366 xs *id = xs_fmt("post-%s%s", hash, ext ? ext : ""); 4366 xs *id = xs_fmt("post-%s%s", hash, ext ? ext : "");
4367 xs *url = xs_fmt("%s/s/%s", snac.actor, id); 4367 xs *url = xs_fmt("%s/s/%s", snac.actor, id);
4368 int fo = xs_number_get(xs_list_get(attach_file, 1)); 4368 int fo = xs_number_get(xs_list_get(attach_file, 1));