From de88a2333be6af82f079d56275869b821fb3588c Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Thu, 8 Sep 2022 13:56:11 +0100 Subject: [PATCH] Check length of of digit string --- daemon.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/daemon.py b/daemon.py index 25998e477..8d499ef7a 100644 --- a/daemon.py +++ b/daemon.py @@ -2801,8 +2801,9 @@ class PubServer(BaseHTTPRequestHandler): page_number_str = options_confirm_params.split('pageNumber=')[1] if '&' in page_number_str: page_number_str = page_number_str.split('&')[0] - if page_number_str.isdigit(): - page_number = int(page_number_str) + if len(page_number_str) < 5: + if page_number_str.isdigit(): + page_number = int(page_number_str) # actor for the person options_actor = options_confirm_params.split('actor=')[1] @@ -4804,7 +4805,10 @@ class PubServer(BaseHTTPRequestHandler): get_nickname_from_actor(remove_post_actor) if self.post_to_nickname: if month_str and year_str: - if month_str.isdigit() and year_str.isdigit(): + if len(month_str) <= 3 and \ + len(year_str) <= 3 and \ + month_str.isdigit() and \ + year_str.isdigit(): year_int = int(year_str) month_int = int(month_str) remove_calendar_event(base_dir,