##// END OF EJS Templates
Allow ftp links to be saved with post
neko259 -
r1674:f45ca462 default
parent child Browse files
Show More
@@ -29,6 +29,7 b' POW_LIFE_MINUTES = 5'
29 29
30 30 REGEX_TAGS = re.compile(r'^[\w\s\d]+$', re.UNICODE)
31 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 34 VETERAN_POSTING_DELAY = 5
34 35
@@ -254,7 +255,7 b' class PostForm(NeboardForm):'
254 255 self._update_file_extension(file)
255 256 except forms.ValidationError as e:
256 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 259 logger.info('Error in forms: {}'.format(e))
259 260 return url
260 261 else:
General Comments 0
You need to be logged in to leave comments. Login now