diff options
| -rw-r--r-- | activitypub.c | 2 | ||||
| -rw-r--r-- | data.c | 4 | ||||
| -rw-r--r-- | format.c | 3 |
3 files changed, 5 insertions, 4 deletions
diff --git a/activitypub.c b/activitypub.c index a7e133a..3ff51ad 100644 --- a/activitypub.c +++ b/activitypub.c | |||
| @@ -903,7 +903,7 @@ xs_str *process_tags(snac *snac, const char *content, xs_list **tag) | |||
| 903 | if (*v == '#') { | 903 | if (*v == '#') { |
| 904 | /* hashtag */ | 904 | /* hashtag */ |
| 905 | xs *d = xs_dict_new(); | 905 | xs *d = xs_dict_new(); |
| 906 | xs *n = xs_tolower_i(xs_dup(v)); | 906 | xs *n = xs_utf8_to_lower(xs_dup(v)); |
| 907 | xs *h = xs_fmt("%s?t=%s", srv_baseurl, n + 1); | 907 | xs *h = xs_fmt("%s?t=%s", srv_baseurl, n + 1); |
| 908 | xs *l = xs_fmt("<a href=\"%s\" class=\"mention hashtag\" rel=\"tag\">%s</a>", h, v); | 908 | xs *l = xs_fmt("<a href=\"%s\" class=\"mention hashtag\" rel=\"tag\">%s</a>", h, v); |
| 909 | 909 | ||
| @@ -2200,7 +2200,7 @@ void tag_index(const char *id, const xs_dict *obj) | |||
| 2200 | if (*name == '\0') | 2200 | if (*name == '\0') |
| 2201 | continue; | 2201 | continue; |
| 2202 | 2202 | ||
| 2203 | name = xs_tolower_i((xs_str *)name); | 2203 | name = xs_utf8_to_lower((xs_str *)name); |
| 2204 | 2204 | ||
| 2205 | xs *md5_tag = xs_md5_hex(name, strlen(name)); | 2205 | xs *md5_tag = xs_md5_hex(name, strlen(name)); |
| 2206 | xs *tag_dir = xs_fmt("%s/%c%c", g_tag_dir, md5_tag[0], md5_tag[1]); | 2206 | xs *tag_dir = xs_fmt("%s/%c%c", g_tag_dir, md5_tag[0], md5_tag[1]); |
| @@ -2230,7 +2230,7 @@ xs_str *tag_fn(const char *tag) | |||
| 2230 | if (*tag == '#') | 2230 | if (*tag == '#') |
| 2231 | tag++; | 2231 | tag++; |
| 2232 | 2232 | ||
| 2233 | xs *lw_tag = xs_tolower_i(xs_dup(tag)); | 2233 | xs *lw_tag = xs_utf8_to_lower(xs_dup(tag)); |
| 2234 | xs *md5 = xs_md5_hex(lw_tag, strlen(lw_tag)); | 2234 | xs *md5 = xs_md5_hex(lw_tag, strlen(lw_tag)); |
| 2235 | 2235 | ||
| 2236 | return xs_fmt("%s/tag/%c%c/%s.idx", srv_basedir, md5[0], md5[1], md5); | 2236 | return xs_fmt("%s/tag/%c%c/%s.idx", srv_basedir, md5[0], md5[1], md5); |
| @@ -8,6 +8,7 @@ | |||
| 8 | #include "xs_json.h" | 8 | #include "xs_json.h" |
| 9 | #include "xs_time.h" | 9 | #include "xs_time.h" |
| 10 | #include "xs_match.h" | 10 | #include "xs_match.h" |
| 11 | #include "xs_unicode.h" | ||
| 11 | 12 | ||
| 12 | #include "snac.h" | 13 | #include "snac.h" |
| 13 | 14 | ||
| @@ -443,7 +444,7 @@ xs_str *sanitize(const char *content) | |||
| 443 | if (n & 0x1) { | 444 | if (n & 0x1) { |
| 444 | xs *s1 = xs_strip_i(xs_crop_i(xs_dup(v), v[1] == '/' ? 2 : 1, -1)); | 445 | xs *s1 = xs_strip_i(xs_crop_i(xs_dup(v), v[1] == '/' ? 2 : 1, -1)); |
| 445 | xs *l1 = xs_split_n(s1, " ", 1); | 446 | xs *l1 = xs_split_n(s1, " ", 1); |
| 446 | xs *tag = xs_tolower_i(xs_dup(xs_list_get(l1, 0))); | 447 | xs *tag = xs_utf8_to_lower(xs_dup(xs_list_get(l1, 0))); |
| 447 | xs *s2 = NULL; | 448 | xs *s2 = NULL; |
| 448 | int i; | 449 | int i; |
| 449 | 450 | ||