in foundation_security_advisories/common_cve.py [0:0]
def parse_bug(bug: dict):
"""
Parse a single given bug from the advisory YAML, and return the
corresponding URL and (optionally) description.
"""
url = str(bug["url"])
desc = str(bug["desc"]) if "desc" in bug else None
if not url.startswith("http"):
if "," in url:
url = "https://bugzilla.mozilla.org/buglist.cgi?bug_id=" + url.replace(
" ", ""
).replace(",", "%2C")
else:
url = "https://bugzilla.mozilla.org/show_bug.cgi?id=" + url
return url, desc