yikes sweety

master
Aevann1 2022-03-05 05:22:38 +02:00
parent aab7646c10
commit 61e7bf32df
2 changed files with 3 additions and 2 deletions

View File

@ -103,6 +103,7 @@ SLURS = {
"elon musk": "rocket daddy",
" elon ": " rocket daddy ",
"fake and gay": "fake and straight",
'<img loading="lazy" data-bs-toggle="tooltip" alt=":n:" title=":n:" class="emoji-md" src="/e/n.webp"> <img loading="lazy" data-bs-toggle="tooltip" alt=":i:" title=":i:" class="emoji-md" src="/e/i.webp"><img loading="lazy" data-bs-toggle="tooltip" alt=":g:" title=":g:" class="emoji-md" src="/e/g.webp"><img loading="lazy" data-bs-toggle="tooltip" alt=":g:" title=":g:" class="emoji-md" src="/e/g.webp"><img loading="lazy" data-bs-toggle="tooltip" alt=":e:" title=":e:" class="emoji-md" src="/e/e.webp"><img loading="lazy" data-bs-toggle="tooltip" alt=":r:" title=":r:" class="emoji-md" src="/e/r.webp">':'<img loading="lazy" data-bs-toggle="tooltip" alt=":b:" title=":b:" class="emoji-md" src="/e/b.webp"> <img loading="lazy" data-bs-toggle="tooltip" alt=":i:" title=":i:" class="emoji-md" src="/e/i.webp"><img loading="lazy" data-bs-toggle="tooltip" alt=":p:" title=":p:" class="emoji-md" src="/e/p.webp"><img loading="lazy" data-bs-toggle="tooltip" alt=":o:" title=":o:" class="emoji-md" src="/e/o.webp"><img loading="lazy" data-bs-toggle="tooltip" alt=":c:" title=":c:" class="emoji-md" src="/e/c.webp">'
}
single_words = "|".join([slur.lower() for slur in SLURS.keys()])

View File

@ -236,7 +236,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False):
if remoji == 'marseyrandom': remoji = choice(marseys_const)
if path.isfile(f'files/assets/images/emojis/{remoji}.webp'):
new = re.sub(f'(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" class="{classes}" src="/e/{remoji}.webp" >', new, flags=re.I|re.A)
new = re.sub(f'(?<!"):{emoji}:', f'<img loading="lazy" data-bs-toggle="tooltip" alt=":{emoji}:" title=":{emoji}:" class="{classes}" src="/e/{remoji}.webp">', new, flags=re.I|re.A)
if comment: marseys_used.add(emoji)
sanitized = sanitized.replace(old, new)
@ -326,7 +326,7 @@ def filter_emojis_only(title, edit=False, graceful=False):
signal.signal(signal.SIGALRM, handler2)
signal.alarm(1)
title = title.replace("<script","").replace("script>","").replace('<','&lt;').replace('>','&gt;').replace("&", "&amp;").replace('"', '&quot;').replace("'", "&#039;").replace("\ufeff", "").replace("𒐪","").replace('','').replace("\n", "").replace("\r", "").replace("\t", "").strip()
title = title.replace("<script","").replace("script>","").replace("&", "&amp;").replace('<','&lt;').replace('>','&gt;').replace('"', '&quot;').replace("'", "&#039;").replace("\ufeff", "").replace("𒐪","").replace('','').replace("\n", "").replace("\r", "").replace("\t", "").strip()
title = bleach.clean(title, tags=[])