diff options
| -rw-r--r-- | html.c | 6 |
1 files changed, 3 insertions, 3 deletions
| @@ -4290,9 +4290,9 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 4290 | char rnd[32]; | 4290 | char rnd[32]; |
| 4291 | xs_rnd_buf(rnd, sizeof(rnd)); | 4291 | xs_rnd_buf(rnd, sizeof(rnd)); |
| 4292 | 4292 | ||
| 4293 | char *ext = strrchr(fn, '.'); | 4293 | const char *ext = strrchr(fn, '.'); |
| 4294 | xs *hash = xs_md5_hex(rnd, strlen(rnd)); | 4294 | xs *hash = xs_md5_hex(rnd, strlen(rnd)); |
| 4295 | xs *id = xs_fmt("p-%s%s", hash, ext ? ext : ""); | 4295 | xs *id = xs_fmt("post-%s%s", hash, ext ? ext : ""); |
| 4296 | xs *url = xs_fmt("%s/s/%s", snac.actor, id); | 4296 | xs *url = xs_fmt("%s/s/%s", snac.actor, id); |
| 4297 | int fo = xs_number_get(xs_list_get(attach_file, 1)); | 4297 | int fo = xs_number_get(xs_list_get(attach_file, 1)); |
| 4298 | int fs = xs_number_get(xs_list_get(attach_file, 2)); | 4298 | int fs = xs_number_get(xs_list_get(attach_file, 2)); |
| @@ -4764,7 +4764,7 @@ int html_post_handler(const xs_dict *req, const char *q_path, | |||
| 4764 | if (xs_startswith(mimetype, "image/")) { | 4764 | if (xs_startswith(mimetype, "image/")) { |
| 4765 | const char *ext = strrchr(fn, '.'); | 4765 | const char *ext = strrchr(fn, '.'); |
| 4766 | xs *hash = xs_md5_hex(fn, strlen(fn)); | 4766 | xs *hash = xs_md5_hex(fn, strlen(fn)); |
| 4767 | xs *id = xs_fmt("%s%s", hash, ext); | 4767 | xs *id = xs_fmt("%s-%s%s", uploads[n], hash, ext ? ext : ""); |
| 4768 | xs *url = xs_fmt("%s/s/%s", snac.actor, id); | 4768 | xs *url = xs_fmt("%s/s/%s", snac.actor, id); |
| 4769 | int fo = xs_number_get(xs_list_get(uploaded_file, 1)); | 4769 | int fo = xs_number_get(xs_list_get(uploaded_file, 1)); |
| 4770 | int fs = xs_number_get(xs_list_get(uploaded_file, 2)); | 4770 | int fs = xs_number_get(xs_list_get(uploaded_file, 2)); |