Skip to content

Commit c5ca057

Browse files
Fix code scanning alert no. 2: Incomplete URL substring sanitization (JesperDramsch#29)
Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com>
1 parent 99129f7 commit c5ca057

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

utils/sort_yaml.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import time
88
from datetime import timezone
99
from pathlib import Path
10-
10+
from urllib.parse import urlparse
1111
import pydantic
1212
import pytz
1313
import yaml
@@ -146,7 +146,8 @@ def check_links(data):
146146
for key in ("link", "cfp_link", "sponsor", "finaid"):
147147
if key in q:
148148
new_link = check_link_availability(q[key], q["start"], cache=cache, cache_archived=cache_archived)
149-
if q[key] != new_link and "archive.org" in new_link:
149+
parsed_url = urlparse(new_link)
150+
if q[key] != new_link and parsed_url.hostname and parsed_url.hostname.endswith("archive.org"):
150151
time.sleep(0.5)
151152
q[key] = new_link
152153
data[i] = q

0 commit comments

Comments
 (0)