Show More
@@ -29,6 +29,7 b' POW_LIFE_MINUTES = 5' | |||||
29 |
|
29 | |||
30 | REGEX_TAGS = re.compile(r'^[\w\s\d]+$', re.UNICODE) |
|
30 | REGEX_TAGS = re.compile(r'^[\w\s\d]+$', re.UNICODE) | |
31 | REGEX_USERNAMES = re.compile(r'^[\w\s\d,]+$', re.UNICODE) |
|
31 | REGEX_USERNAMES = re.compile(r'^[\w\s\d,]+$', re.UNICODE) | |
|
32 | REGEX_URL = re.compile(r'^(http|https|ftp|magnet):\/\/', re.UNICODE) | |||
32 |
|
33 | |||
33 | VETERAN_POSTING_DELAY = 5 |
|
34 | VETERAN_POSTING_DELAY = 5 | |
34 |
|
35 | |||
@@ -254,7 +255,7 b' class PostForm(NeboardForm):' | |||||
254 | self._update_file_extension(file) |
|
255 | self._update_file_extension(file) | |
255 | except forms.ValidationError as e: |
|
256 | except forms.ValidationError as e: | |
256 | # Assume we will get the plain URL instead of a file and save it |
|
257 | # Assume we will get the plain URL instead of a file and save it | |
257 | if url.startswith('http://') or url.startswith('https://'): |
|
258 | if REGEX_URL.match(url): | |
258 | logger.info('Error in forms: {}'.format(e)) |
|
259 | logger.info('Error in forms: {}'.format(e)) | |
259 | return url |
|
260 | return url | |
260 | else: |
|
261 | else: |
General Comments 0
You need to be logged in to leave comments.
Login now