From 513d10e25a71e6711921a2151b152e194a49121a Mon Sep 17 00:00:00 2001 From: Aevann1 Date: Tue, 22 Feb 2022 15:00:41 +0200 Subject: [PATCH] fdg --- Dockerfile | 12 +++++++++++- files/helpers/sanitize.py | 6 ++++-- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3f846d3de..494da0606 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,16 @@ FROM ubuntu:20.04 -RUN apt update && apt -y upgrade && apt install -y supervisor python3-pip ffmpeg +RUN apt update + +RUN apt -y upgrade + +RUN apt install -y supervisor + +RUN apt install -y python3-pip + +RUN apt install -y python3-enchant + +RUN apt install -y libenchant1c2a COPY supervisord.conf /etc/supervisord.conf diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 9009eb09e..60f9adc13 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -113,7 +113,7 @@ def handler(signum, frame): def sanitize(sanitized, noimages=False, alert=False, comment=False, edit=False): signal.signal(signal.SIGALRM, handler) - signal.alarm(1) + signal.alarm(2) if sanitized.count(':') > 100: abort(418) if sanitized.count('@') > 50: abort(418) @@ -305,7 +305,7 @@ def handler2(signum, frame): def filter_emojis_only(title, edit=False, graceful=False): signal.signal(signal.SIGALRM, handler2) - signal.alarm(1) + signal.alarm(2) if title.count(':') > 100: abort(418) if title.count('@') > 50: abort(418) @@ -342,6 +342,8 @@ def filter_emojis_only(title, edit=False, graceful=False): if path.isfile(f'files/assets/images/emojis/{emoji}.webp'): title = re.sub(f'(?', title, re.I) + title = re.sub('~~(.*?)~~', r'\1', title) + signal.alarm(0) if len(title) > 1500 and not graceful: abort(400)