diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index ef88ac6e9..194abeac4 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -227,7 +227,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): if remoji == 'marseyrandom': remoji = choice(marseys) if path.isfile(f'files/assets/images/emojis/{remoji}.webp'): - new = re.sub(f'(?', new, flags=re.I) + new = re.sub(f'(?', new, flags=re.I) if comment: marseys_used.add(emoji) sanitized = sanitized.replace(old, new) @@ -251,7 +251,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): else: emoji = old if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - sanitized = re.sub(f'(?', sanitized, flags=re.I) + sanitized = re.sub(f'(?', sanitized, flags=re.I) if comment: marseys_used.add(emoji) else: classes = 'emoji' @@ -262,7 +262,7 @@ def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): else: emoji = old if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - sanitized = re.sub(f'(?', sanitized, flags=re.I) + sanitized = re.sub(f'(?', sanitized, flags=re.I) if comment: marseys_used.add(emoji) sanitized = sanitized.replace("https://youtu.be/", "https://youtube.com/watch?v=").replace("https://music.youtube.com/watch?v=", "https://youtube.com/watch?v=").replace("https://streamable.com/", "https://streamable.com/e/").replace("https://youtube.com/shorts/", "https://youtube.com/watch?v=").replace("https://mobile.twitter", "https://twitter").replace("https://m.facebook", "https://facebook").replace("m.wikipedia.org", "wikipedia.org").replace("https://m.youtube", "https://youtube").replace("https://www.youtube", "https://youtube") @@ -339,7 +339,7 @@ def filter_emojis_only(title, edit=False, graceful=False): else: emoji = old if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - title = re.sub(f'(?', title, flags=re.I) + title = re.sub(f'(?', title, flags=re.I) else: classes = 'emoji' @@ -350,7 +350,7 @@ def filter_emojis_only(title, edit=False, graceful=False): else: emoji = old if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): - title = re.sub(f'(?', title, flags=re.I) + title = re.sub(f'(?', title, flags=re.I) title = re.sub('~~(.*?)~~', r'\1', title) diff --git a/files/routes/comments.py b/files/routes/comments.py index 178588040..81a84dd76 100644 --- a/files/routes/comments.py +++ b/files/routes/comments.py @@ -281,7 +281,7 @@ def api_comment(v): filename = f'files/assets/images/emojis/{name}.webp' copyfile(oldname, filename) process_image(filename, 200) - requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/e/{name}"]}, timeout=5) + requests.post(f'https://api.cloudflare.com/client/v4/zones/{CF_ZONE}/purge_cache', headers=CF_HEADERS, data={'files': [f"https://{request.host}/e/{name}.webp"]}, timeout=5) cache.delete_memoized(marsey_list) except Exception as e: return {"error": str(e)}, 400 diff --git a/files/routes/static.py b/files/routes/static.py index 8b1da44b1..1538029f1 100644 --- a/files/routes/static.py +++ b/files/routes/static.py @@ -336,7 +336,8 @@ def archives(path): @app.get('/e/') @limiter.exempt def emoji(emoji): - resp = make_response(send_from_directory('assets/images/emojis', f'{emoji}.webp')) + if not emoji.endswith('.webp'): emoji += '.webp' + resp = make_response(send_from_directory('assets/images/emojis', emoji)) resp.headers.remove("Cache-Control") resp.headers.add("Cache-Control", "public, max-age=3153600") resp.headers.remove("Content-Type") diff --git a/files/templates/comments.html b/files/templates/comments.html index ea2bc71c7..4d0abddd5 100644 --- a/files/templates/comments.html +++ b/files/templates/comments.html @@ -873,7 +873,7 @@ {% endif %} {% if v %} - + {% endif %} diff --git a/files/templates/emoji_modal.html b/files/templates/emoji_modal.html index a3249055a..1f435e2bb 100644 --- a/files/templates/emoji_modal.html +++ b/files/templates/emoji_modal.html @@ -106,4 +106,4 @@ - \ No newline at end of file + \ No newline at end of file diff --git a/files/templates/errors/400.html b/files/templates/errors/400.html index 19252653b..f82235ca2 100644 --- a/files/templates/errors/400.html +++ b/files/templates/errors/400.html @@ -10,7 +10,7 @@
- :#marseybrainlet: + :#marseybrainlet:

 			

400 Bad Request

That request was bad and you should feel bad.

diff --git a/files/templates/errors/401.html b/files/templates/errors/401.html index f0103a28e..e41ca8582 100644 --- a/files/templates/errors/401.html +++ b/files/templates/errors/401.html @@ -11,7 +11,7 @@
- :#marseydead: + :#marseydead:

 
 			

401 Not Authorized

diff --git a/files/templates/errors/403.html b/files/templates/errors/403.html index 480a39b8c..737da12af 100644 --- a/files/templates/errors/403.html +++ b/files/templates/errors/403.html @@ -10,7 +10,7 @@
- :#marseytroll: + :#marseytroll:

 		

403 Forbidden

YOU AREN'T WELCOME HERE GO AWAY

diff --git a/files/templates/errors/404.html b/files/templates/errors/404.html index e6485a705..bcce53f0e 100644 --- a/files/templates/errors/404.html +++ b/files/templates/errors/404.html @@ -10,7 +10,7 @@
- :#marseyconfused + :#marseyconfused

 		

404 Page Not Found

Someone typed something wrong and it was probably you, please do better.

diff --git a/files/templates/errors/405.html b/files/templates/errors/405.html index d049497cb..12e4accac 100644 --- a/files/templates/errors/405.html +++ b/files/templates/errors/405.html @@ -10,7 +10,7 @@
- :#marseyretard: + :#marseyretard:

 		

405 Method Not Allowed

idk how anyone gets this error but if you see this, remember to follow @carpathianflorist
the original error text here talked about internet gremlins and wtf

diff --git a/files/templates/errors/429.html b/files/templates/errors/429.html index 8533b7873..7eaecda90 100644 --- a/files/templates/errors/429.html +++ b/files/templates/errors/429.html @@ -10,7 +10,7 @@
- :#marseyrentfree: + :#marseyrentfree:

 		

429 Too Many Requests

go spam somewhere else nerd

diff --git a/files/templates/errors/500.html b/files/templates/errors/500.html index c85f081a8..c6c5c06b7 100644 --- a/files/templates/errors/500.html +++ b/files/templates/errors/500.html @@ -10,7 +10,7 @@
- :#marseydead: + :#marseydead:

 			

500 Internal Server Error

Hiiiii it's carp! I think this error means that there's a timeout error. And I think that means something took too long to load so it decided not to work at all. If you keep seeing this on the same page but not other pages, then something is probably wrong with that specific function. It may not be called a function, but that sounds right to me. Anyway, ping me and I'll whine to someone smarter to fix it. Don't bother them. Thanks ily <3

diff --git a/files/templates/errors/nsfw.html b/files/templates/errors/nsfw.html index e3579fb00..459383a98 100644 --- a/files/templates/errors/nsfw.html +++ b/files/templates/errors/nsfw.html @@ -10,7 +10,7 @@
- :#marseytwerking: + :#marseytwerking:

Are you over 18?

This post is rated +18 (Adult-Only). You must be 18 or older to continue. Are you sure you want to proceed?

diff --git a/files/templates/errors/patron.html b/files/templates/errors/patron.html index 3b49c7ca5..af6cf8d66 100644 --- a/files/templates/errors/patron.html +++ b/files/templates/errors/patron.html @@ -11,7 +11,7 @@
- :#marseymerchant: + :#marseymerchant:

401 Not Authorized

This page is only available to {% if SITE_NAME == 'Drama' %}paypigs{% else %}patrons{% endif %}:

{{config('GUMROAD_LINK')}} diff --git a/files/templates/formatting.html b/files/templates/formatting.html index 220a3faff..052751aae 100644 --- a/files/templates/formatting.html +++ b/files/templates/formatting.html @@ -69,22 +69,22 @@ You can use Markdown formatting: Emojis :marseylove: - :marseylove: + :marseylove: Mirrored Emojis :!marseylove: - :!marseylove: + :!marseylove: Large Emojis :#marseylove: - :!marseylove: + :!marseylove: Large Mirrored Emojis :#!marseylove: - :!marseylove: + :!marseylove: Random Marsey diff --git a/files/templates/header.html b/files/templates/header.html index 23b2674c7..daa914ca6 100644 --- a/files/templates/header.html +++ b/files/templates/header.html @@ -33,7 +33,7 @@ {% if SITE_NAME == 'Drama' %} {% set icon = ('marseyblm','marseykween','marseydynamite','marseyblack','marseymyeisha','marseyetika','marseyobama','marseyblackcop','marseysosa','marseyblackface')|random() %} - header icon + header icon {% else %} header icon {% endif %} diff --git a/files/templates/log.html b/files/templates/log.html index 21479f251..d2c650d28 100644 --- a/files/templates/log.html +++ b/files/templates/log.html @@ -56,10 +56,10 @@