forked from MarseyWorld/MarseyWorld
fix bug that caused urls with quoted spaces to not work https://i.imgur.com/RFyI9jB.png
parent
aacffe0d1c
commit
5b86ee21b0
|
@ -660,7 +660,6 @@ def normalize_url(url):
|
|||
|
||||
url = imgur_regex.sub(r'\1_d.webp?maxwidth=9999&fidelity=grand', url)
|
||||
url = giphy_regex.sub(r'\1.webp', url)
|
||||
url = unquote(url)
|
||||
|
||||
return url
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@ from io import BytesIO
|
|||
from os import path
|
||||
from shutil import copyfile
|
||||
from sys import stdout
|
||||
from urllib.parse import ParseResult, urlparse, urlunparse
|
||||
from urllib.parse import ParseResult, urlparse, urlunparse, unquote
|
||||
|
||||
import gevent
|
||||
import requests
|
||||
|
@ -407,6 +407,7 @@ def is_repost(v):
|
|||
if not url or len(url) < MIN_REPOST_CHECK_URL_LENGTH: abort(400)
|
||||
|
||||
url = normalize_url(url)
|
||||
url = unquote(url)
|
||||
parsed_url = urlparse(url)
|
||||
|
||||
domain = parsed_url.netloc
|
||||
|
@ -496,6 +497,7 @@ def submit_post(v:User, sub=None):
|
|||
|
||||
if url:
|
||||
url = normalize_url(url)
|
||||
url = unquote(url)
|
||||
parsed_url = urlparse(url)
|
||||
|
||||
domain = parsed_url.netloc
|
||||
|
|
Loading…
Reference in New Issue