You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

16 lines
432 B

from re import compile, sub
def domain_ok(domain):
8 months ago
domains = ["jet", "jw", "404", "dash", "awesome", "mirror"]
if domain.count(".") == 1:
if domain.split(".")[1] in domains:
# ../some => some
# Защита от проверки папок выше, чем нужно и др.
8 months ago
regex = compile('[^a-zA-Zа-яА-ЯЁё.-]')
c_domain = regex.sub('', domain)
if domain == c_domain:
return domain
return False