Help: Change URL sanitization to be safer

This commit is contained in:
Chris Hennes
2025-06-15 19:16:07 -05:00
committed by Yorik van Havre
parent 9b3b15ebfe
commit 55696b6a57

View File

@@ -169,7 +169,7 @@ def location_url(url_localized: str, url_english: str) -> tuple:
req = urllib.request.Request(url_localized)
with urllib.request.urlopen(req) as response:
html = response.read().decode("utf-8")
if re.search(MD_RAW_URL, url_localized):
if url_localized.startswith(MD_RAW_URL):
pagename_match = re.search(r"Name/.*?:\s*(.+)", html)
else:
# Pages from FreeCAD Wiki fall here