diff --git a/daemon.py b/daemon.py index 2708f8ff6..75aa0f517 100644 --- a/daemon.py +++ b/daemon.py @@ -12120,6 +12120,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -12294,6 +12296,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -12457,6 +12461,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -12619,6 +12625,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -12778,6 +12786,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -12938,6 +12948,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -13103,6 +13115,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -13260,6 +13274,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -13356,6 +13372,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -13465,6 +13483,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -13623,6 +13643,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 0 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -13768,6 +13790,8 @@ class PubServer(BaseHTTPRequestHandler): page_number = 1 if '?page=' in nickname: page_number = nickname.split('?page=')[1] + if ';' in page_number: + page_number = page_number.split(';')[0] nickname = nickname.split('?page=')[0] if len(page_number) > 5: page_number = "1" @@ -13927,6 +13951,8 @@ class PubServer(BaseHTTPRequestHandler): SHARES_PER_PAGE) else: page_number_str = path.split('?page=')[1] + if ';' in page_number_str: + page_number_str = page_number_str.split(';')[0] if '#' in page_number_str: page_number_str = page_number_str.split('#')[0] if len(page_number_str) > 5: @@ -14062,6 +14088,8 @@ class PubServer(BaseHTTPRequestHandler): authorized, FOLLOWS_PER_PAGE) else: page_number_str = path.split('?page=')[1] + if ';' in page_number_str: + page_number_str = page_number_str.split(';')[0] if '#' in page_number_str: page_number_str = page_number_str.split('#')[0] if len(page_number_str) > 5: @@ -14200,6 +14228,8 @@ class PubServer(BaseHTTPRequestHandler): 'followers') else: page_number_str = path.split('?page=')[1] + if ';' in page_number_str: + page_number_str = page_number_str.split(';')[0] if '#' in page_number_str: page_number_str = page_number_str.split('#')[0] if len(page_number_str) > 5: @@ -14578,6 +14608,8 @@ class PubServer(BaseHTTPRequestHandler): nickname = nickname.split('?')[0] if '?page=' in path: page_number_str = path.split('?page=')[1] + if ';' in page_number_str: + page_number_str = page_number_str.split(';')[0] if '?' in page_number_str: page_number_str = page_number_str.split('?')[0] if '#' in page_number_str: diff --git a/webapp_timeline.py b/webapp_timeline.py index 645b2861c..e5a3511c6 100644 --- a/webapp_timeline.py +++ b/webapp_timeline.py @@ -948,6 +948,8 @@ def html_timeline(default_timeline: str, if box_name == 'inbox': use_cache_only = True + last_post_id = '' + if timeline_json: # if this is the media timeline then add an extra gallery container if box_name == 'tlmedia': @@ -981,6 +983,7 @@ def html_timeline(default_timeline: str, curr_tl_str, box_name, page_number) + last_post_id = post_id _log_timeline_timing(enable_timing_log, timeline_start_time, box_name, '10') @@ -1027,6 +1030,8 @@ def html_timeline(default_timeline: str, if curr_tl_str: if curr_tl_str not in tl_str: + last_post_id = \ + remove_id_ending(item['id']).replace('/', '#') item_ctr += 1 tl_str += text_mode_separator + curr_tl_str if separator_str: @@ -1041,11 +1046,14 @@ def html_timeline(default_timeline: str, # page down arrow if item_ctr > 0: tl_str += text_mode_separator + first_post = '' + if last_post_id: + first_post = ';firstpost=' + last_post_id tl_str += \ '
\n' + \ '
\n' + \ ' ' + \ '