fix this https://rdrama.net/h/changelog/post/165657/changelog-megathread-marseynotes/5118144#context
parent
8062b33140
commit
2b8c076249
|
@ -456,6 +456,9 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
|||
|
||||
soup = BeautifulSoup(sanitized, 'lxml')
|
||||
|
||||
if len(soup.select('[bounce], [cide]')) > 5:
|
||||
error("Max 5 'bounce' and 'cide'!")
|
||||
|
||||
for tag in soup.find_all("img"):
|
||||
if tag.get("src") and not tag["src"].startswith('/pp/') and not (snappy and tag["src"].startswith(f'{SITE_FULL_IMAGES}/e/')):
|
||||
if not is_safe_url(tag["src"]):
|
||||
|
@ -648,9 +651,6 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=False, count_emojis
|
|||
if sanitized.count("blur(") + sanitized.count("drop-shadow(") > 5:
|
||||
error("Too many filters!")
|
||||
|
||||
if sanitized.count("bounce") + sanitized.count("cide") > 5:
|
||||
error("Too many 'bounce' and 'cide'!")
|
||||
|
||||
return sanitized.strip()
|
||||
|
||||
def allowed_attributes_emojis(tag, name, value):
|
||||
|
|
Loading…
Reference in New Issue