Преглед изворни кода

Fix for some repeated search results.

default пре 1 година
родитељ
комит
c1bc0c7518
1 измењених фајлова са 5 додато и 0 уклоњено
  1. 5 0
      data.c

+ 5 - 0
data.c

@@ -2742,6 +2742,11 @@ xs_list *content_search(snac *user, const char *regex,
         if (id == NULL || is_hidden(user, id))
         if (id == NULL || is_hidden(user, id))
             continue;
             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 */
         /* test for the post URL */
         if (strcmp(id, regex) == 0) {
         if (strcmp(id, regex) == 0) {
             if (xs_set_add(&seen, md5) == 1)
             if (xs_set_add(&seen, md5) == 1)