Browse Source

validation.py: check for http:/ in hostname

This is a common error.
pull/1/head
Hidden Z 14 years ago
parent
commit
b5c5a4051c
  1. 2
      web/lib/validation.py

2
web/lib/validation.py

@ -26,6 +26,8 @@ def validate_hostname(data): @@ -26,6 +26,8 @@ def validate_hostname(data):
# prevent common errors
if re.match(r'\.i2p$', data):
raise forms.ValidationError('Incomplete hostname')
if re.match(r'^http:/', data):
raise forms.ValidationError('Do not paste full URL, just domain')
# Must not contain '..'
if re.search(r'\.\.', data):
raise forms.ValidationError('".." in hostname')

Loading…
Cancel
Save