mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-25 14:35:04 +00:00
Use an md5 instead of a fixed file name in avatars and headers.
This commit is contained in:
parent
922e0bc919
commit
770fc331fd
1 changed files with 2 additions and 1 deletions
3
html.c
3
html.c
|
@ -2590,7 +2590,8 @@ int html_post_handler(const xs_dict *req, const char *q_path,
|
|||
|
||||
if (xs_startswith(mimetype, "image/")) {
|
||||
const char *ext = strrchr(fn, '.');
|
||||
xs *id = xs_fmt("%s%s", uploads[n], ext);
|
||||
xs *hash = xs_md5_hex(fn, strlen(fn));
|
||||
xs *id = xs_fmt("%s%s", hash, ext);
|
||||
xs *url = xs_fmt("%s/s/%s", snac.actor, id);
|
||||
int fo = xs_number_get(xs_list_get(uploaded_file, 1));
|
||||
int fs = xs_number_get(xs_list_get(uploaded_file, 2));
|
||||
|
|
Loading…
Reference in a new issue