Skip to content

Commit 97a94c0

Browse files
committed
fix: update regex patterns for version extraction to handle whitespace (@k1ril1ks)
1 parent f797e3a commit 97a94c0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/lib/wordfence_api_parser.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ def process_item(self, json_object, overwrite, force, overwrite_enhanced, tag):
126126
description = json_object.get('description')
127127
if description is None:
128128
description = ""
129-
129+
130130
if tag is None:
131131
tag = ""
132132

@@ -413,11 +413,11 @@ def get_version_regex(self, software_type, vuln):
413413
obj = self.edge_cases.get(object_slug)
414414
regex = obj.get('regex')
415415
elif software_type == "theme":
416-
regex = "(?mi)Version:\\s*([0-9.]+)"
416+
regex = "(?mi)Version:\\\s*([0-9.]+)"
417417
elif software_type == "core":
418418
regex = "(?mi)\?v=([0-9.]+)"
419419
else:
420-
regex = "(?mi)Stable tag:\\s*([0-9.]+)"
420+
regex = "(?mi)Stable tag:\\\s*([0-9.]+)"
421421

422422
return regex
423423

0 commit comments

Comments
 (0)