forked from MarseyWorld/MarseyWorld
don't bother try checking invalid urls
parent
d3b7f043c6
commit
b1924e0cdf
|
@ -1068,6 +1068,8 @@ extensions = IMAGE_FORMATS + VIDEO_FORMATS + AUDIO_FORMATS
|
||||||
def get_post_title(v):
|
def get_post_title(v):
|
||||||
url = request.values.get("url")
|
url = request.values.get("url")
|
||||||
if not url or '\\' in url: abort(400)
|
if not url or '\\' in url: abort(400)
|
||||||
|
url = url.strip()
|
||||||
|
if not url.startswith('http'): abort(400)
|
||||||
|
|
||||||
checking_url = url.lower().split('?')[0].split('%3F')[0]
|
checking_url = url.lower().split('?')[0].split('%3F')[0]
|
||||||
if any((checking_url.endswith(f'.{x}') for x in extensions)):
|
if any((checking_url.endswith(f'.{x}') for x in extensions)):
|
||||||
|
|
Loading…
Reference in New Issue