mirror of
https://github.com/Justuser3310/jetwork.git
synced 2025-01-19 01:18:48 +00:00
16 lines
389 B
Python
16 lines
389 B
Python
from re import compile, sub
|
|
|
|
def domain_ok(domain):
|
|
domains = ["jet"]
|
|
|
|
if domain.count(".") == 1:
|
|
if domain.split(".")[1] in domains:
|
|
# ../some => some
|
|
# Защита от проверки папок выше, чем нужно и др.
|
|
regex = compile('[^a-zA-Zа-яА-ЯЁё.]')
|
|
c_domain = regex.sub('', domain)
|
|
if domain == c_domain:
|
|
return domain
|
|
|
|
return False
|