commit b5f0b4b
default
·
2025-03-17 07:24:37 +0000 UTC
parent b2b7d91
Minor tweak.
1 files changed,
+2,
-3
+2,
-3
1@@ -2125,9 +2125,8 @@ int mastoapi_get_handler(const xs_dict *req, const char *q_path,
2 xs *current = xs_dict_new();
3 if (xs_startswith(v, "https://") && xs_startswith((xs_mime_by_ext(v)), "image/")) {
4 /* remove first and last colon */
5- char *shortcode = (char *)k;
6- shortcode[strlen(k) - 1] = '\0';
7- current = xs_dict_append(current, "shortcode", shortcode + 1);
8+ xs *shortcode = xs_replace(k, ":", "");
9+ current = xs_dict_append(current, "shortcode", shortcode);
10 current = xs_dict_append(current, "url", v);
11 current = xs_dict_append(current, "static_url", v);
12 current = xs_dict_append(current, "visible_in_picker", xs_stock(XSTYPE_TRUE));