aboutsummaryrefslogtreecommitdiff
path: root/data.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2025-01-01 17:40:57 +0100
committerdefault <nobody@localhost>2025-01-01 17:40:57 +0100
commitc1bc0c75185736210a14ce81ea515fafd6ef0617 (patch)
tree03cbd5f2ac1069b52a5b4ecef0c8be7b7e75e1a9 /data.c
parentf72fbce22d6362e52dee7b6b3f5af78393791605 (diff)
Fix for some repeated search results.
Diffstat (limited to 'data.c')
-rw-r--r--data.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/data.c b/data.c
index 36c41f3..6202465 100644
--- a/data.c
+++ b/data.c
@@ -2742,6 +2742,11 @@ xs_list *content_search(snac *user, const char *regex,
if (id == NULL || is_hidden(user, id))
continue;
+ /* recalculate the md5 id to be sure it's not repeated
+ (it may have been searched by the "url" field instead of "id") */
+ xs *new_md5 = xs_md5_hex(id, strlen(id));
+ md5 = new_md5;
+
/* test for the post URL */
if (strcmp(id, regex) == 0) {
if (xs_set_add(&seen, md5) == 1)