diff options
| author | 2025-01-01 17:40:57 +0100 | |
|---|---|---|
| committer | 2025-01-01 17:40:57 +0100 | |
| commit | c1bc0c75185736210a14ce81ea515fafd6ef0617 (patch) | |
| tree | 03cbd5f2ac1069b52a5b4ecef0c8be7b7e75e1a9 /data.c | |
| parent | Bumped version. (diff) | |
| download | penes-snac2-c1bc0c75185736210a14ce81ea515fafd6ef0617.tar.gz penes-snac2-c1bc0c75185736210a14ce81ea515fafd6ef0617.tar.xz penes-snac2-c1bc0c75185736210a14ce81ea515fafd6ef0617.zip | |
Fix for some repeated search results.
Diffstat (limited to '')
| -rw-r--r-- | data.c | 5 |
1 files changed, 5 insertions, 0 deletions
| @@ -2742,6 +2742,11 @@ xs_list *content_search(snac *user, const char *regex, | |||
| 2742 | if (id == NULL || is_hidden(user, id)) | 2742 | if (id == NULL || is_hidden(user, id)) |
| 2743 | continue; | 2743 | continue; |
| 2744 | 2744 | ||
| 2745 | /* recalculate the md5 id to be sure it's not repeated | ||
| 2746 | (it may have been searched by the "url" field instead of "id") */ | ||
| 2747 | xs *new_md5 = xs_md5_hex(id, strlen(id)); | ||
| 2748 | md5 = new_md5; | ||
| 2749 | |||
| 2745 | /* test for the post URL */ | 2750 | /* test for the post URL */ |
| 2746 | if (strcmp(id, regex) == 0) { | 2751 | if (strcmp(id, regex) == 0) { |
| 2747 | if (xs_set_add(&seen, md5) == 1) | 2752 | if (xs_set_add(&seen, md5) == 1) |