mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-02-16 17:35:12 -05:00
Handle case where subdomain is None in is_subdomain.
This commit is contained in:
@@ -213,7 +213,7 @@ def strip_www(domain):
|
||||
|
||||
def is_subdomain(subdomain, base):
|
||||
"""Check if a domain is equal to or a subdomain of a base domain."""
|
||||
return subdomain == base or subdomain.endswith('.' + base)
|
||||
return subdomain == base or (subdomain is not None and subdomain.endswith('.' + base))
|
||||
|
||||
r_base_url = re.compile("(?i)(?:.+?://)?(?:www[\d]*\.)?([^#]*[^#/])/?")
|
||||
def base_url(url):
|
||||
|
||||
Reference in New Issue
Block a user