diff --git a/files/helpers/config/const.py b/files/helpers/config/const.py index bc0938e8a..c4f32cb5c 100644 --- a/files/helpers/config/const.py +++ b/files/helpers/config/const.py @@ -77,7 +77,7 @@ SESSION_LIFETIME = 60 * 60 * 24 * 365 CASINO_RELEASE_DAY = 1662825600 -AJ_REPLACEMENTS = { +CHUD_REPLACEMENTS = { ' your ': " you're ", ' to ': " too ", diff --git a/files/helpers/sanitize.py b/files/helpers/sanitize.py index 983d20ae9..b663f446a 100644 --- a/files/helpers/sanitize.py +++ b/files/helpers/sanitize.py @@ -677,9 +677,9 @@ def validate_css(css): return True, "" -def torture_ap(string, username): +def torture_chud(string, username): if not string: return string - for k, l in AJ_REPLACEMENTS.items(): + for k, l in CHUD_REPLACEMENTS.items(): string = string.replace(k, l) string = torture_regex.sub(rf'\1@{username}\3', string) string = torture_regex2.sub(rf'\1@{username} is\3', string) @@ -748,12 +748,12 @@ def complies_with_chud(obj): soup = BeautifulSoup(obj.body_html, 'lxml') tags = soup.html.body.find_all(lambda tag: tag.name not in {'blockquote','codeblock','pre'} and tag.string, recursive=False) for tag in tags: - tag.string.replace_with(torture_ap(tag.string, obj.author.username)) + tag.string.replace_with(torture_chud(tag.string, obj.author.username)) obj.body_html = str(soup).replace('','').replace('','') #torture title_html and check for chud_phrase in plain title and leave if it's there if isinstance(obj, Post): - obj.title_html = torture_ap(obj.title_html, obj.author.username) + obj.title_html = torture_chud(obj.title_html, obj.author.username) if obj.author.chud_phrase in obj.title.lower(): return True