From 5306ca343d59a50289dd6cc18b4e456bb7497b58 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Zaj=C4=85c?= Date: Wed, 20 Mar 2024 09:09:40 +0100 Subject: [PATCH 1/2] Minor bugfixes: fuzzing files and themes having >1M installs --- fuzz_object.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fuzz_object.py b/fuzz_object.py index a90f56d..fcc93b1 100644 --- a/fuzz_object.py +++ b/fuzz_object.py @@ -79,11 +79,11 @@ def fuzz_object( if "active_installs" not in object_info_dict: soup = bs4.BeautifulSoup(requests.get(f"https://wordpress.org/{object_type.value}s/{slug}/").content) object_info_dict["active_installs"] = ( - soup.select("p.active_installs > strong")[0].text.replace("+", "").replace(",", "") + soup.select("p.active_installs > strong")[0].text.replace("+", "").replace(",", "").replace("millions", "million").replace(" million", "000000") ) if file_or_folder_to_fuzz == "OBJECT_ROOT": - file_or_folder_to_fuzz = f"/var/www/html/wp-content/{object_type}s/{slug}" + file_or_folder_to_fuzz = f"/var/www/html/wp-content/{object_type.value}s/{slug}" if version is None: version = object_info_dict["version"] From bcdada58011d5541e42a8d49d507eaa376b396d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krzysztof=20Zaj=C4=85c?= Date: Wed, 20 Mar 2024 09:12:24 +0100 Subject: [PATCH 2/2] lint --- fuzz_object.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/fuzz_object.py b/fuzz_object.py index fcc93b1..09d07b8 100644 --- a/fuzz_object.py +++ b/fuzz_object.py @@ -79,7 +79,11 @@ def fuzz_object( if "active_installs" not in object_info_dict: soup = bs4.BeautifulSoup(requests.get(f"https://wordpress.org/{object_type.value}s/{slug}/").content) object_info_dict["active_installs"] = ( - soup.select("p.active_installs > strong")[0].text.replace("+", "").replace(",", "").replace("millions", "million").replace(" million", "000000") + soup.select("p.active_installs > strong")[0] + .text.replace("+", "") + .replace(",", "") + .replace("millions", "million") + .replace(" million", "000000") ) if file_or_folder_to_fuzz == "OBJECT_ROOT":