From 6bf4e26ea898e7c11430ebb2b5a6455a7e22b373 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Fri, 6 Jan 2023 11:17:33 +0000 Subject: [PATCH] Ensure that the number of posts is not excessively large --- webapp_search.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/webapp_search.py b/webapp_search.py index d548f6d2f..1f2920c63 100644 --- a/webapp_search.py +++ b/webapp_search.py @@ -1153,6 +1153,7 @@ def html_hashtag_search_remote(nickname: str, domain: str, port: int, '" alt="' + translate['Page up'] + \ '">\n \n' text_mode_separator = '

' + post_ctr = 0 for post_id in lines: print('Hashtag post_id ' + post_id) post_json_object = \ @@ -1233,10 +1234,13 @@ def html_hashtag_search_remote(nickname: str, domain: str, port: int, if post_str: hashtag_search_form += \ text_mode_separator + separator_str + post_str + post_ctr += 1 + if post_ctr >= posts_per_page: + break hashtag_search_form += text_mode_separator - if len(lines) >= 5 and hashtag_json.get('next'): + if post_ctr >= 5 and hashtag_json.get('next'): # next page link hashtag_search_form += \ '
\n' + \