forked from MarseyWorld/MarseyWorld
Fix safe_url bypass for profilecss external embeds.
parent
6045667b91
commit
59344a28cd
|
@ -998,7 +998,7 @@ approved_embed_hosts = {
|
||||||
|
|
||||||
|
|
||||||
def is_site_url(url):
|
def is_site_url(url):
|
||||||
return url and '\\' not in url and (url.startswith('/') or url.startswith(f'{SITE_FULL}/'))
|
return url and '\\' not in url and ((url.startswith('/') and not url.startswith('//')) or url.startswith(f'{SITE_FULL}/'))
|
||||||
|
|
||||||
def is_safe_url(url):
|
def is_safe_url(url):
|
||||||
return is_site_url(url) or tldextract.extract(url).registered_domain in approved_embed_hosts
|
return is_site_url(url) or tldextract.extract(url).registered_domain in approved_embed_hosts
|
||||||
|
|
|
@ -80,7 +80,7 @@ image_regex = re.compile("(^|\s)(https:\/\/[\w\-.#&/=\?@%;+,:]{5,250}(\.png|\.jp
|
||||||
|
|
||||||
link_fix_regex = re.compile("(\[.*?\]\()(?!http|/)(.*?\))", flags=re.A)
|
link_fix_regex = re.compile("(\[.*?\]\()(?!http|/)(.*?\))", flags=re.A)
|
||||||
|
|
||||||
css_regex = re.compile('https?:\/\/[\w:~,()\-.#&\/=?@%;+]*', flags=re.I|re.A)
|
css_regex = re.compile('(https?:)?\/\/[\w:~,()\-.#&\/=?@%;+]*', flags=re.I|re.A)
|
||||||
|
|
||||||
procoins_li = (0,2500,5000,10000,25000,50000,125000,250000)
|
procoins_li = (0,2500,5000,10000,25000,50000,125000,250000)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue