diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 33d514d0c2..8d4f8cbd57 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -134,7 +134,7 @@ def sanitize(sanitized, noimages=False): tag.wrap(link) for tag in soup.find_all("a"): - if tag["href"]: + if tag.get("href"): tag["target"] = "_blank" if site not in tag["href"]: tag["rel"] = "nofollow noopener noreferrer"