forked from MarseyWorld/MarseyWorld
remove redundant domain bans
parent
ad34c7df3f
commit
5d6d108dd5
|
@ -400,7 +400,7 @@ def sanitize(sanitized, golden=True, limit_pings=0, showmore=True, count_marseys
|
|||
for x in banned_domains:
|
||||
for y in domain_list:
|
||||
if y.startswith(x.domain):
|
||||
abort(403, description=f'Remove the banned link "{x.domain}" and try again!\nReason for link ban: "{x.reason}"')
|
||||
abort(403, f'Remove the banned link "{x.domain}" and try again!\nReason for link ban: "{x.reason}"')
|
||||
|
||||
if '<pre>' not in sanitized and not sidebar:
|
||||
sanitized = sanitized.replace('\n','')
|
||||
|
|
|
@ -85,9 +85,6 @@ def speak(data, v):
|
|||
|
||||
if v.shadowbanned or not execute_blackjack(v, None, text, "chat"):
|
||||
emit('speak', data)
|
||||
elif ('discord.gg' in text or 'discord.com' in text or 'discordapp.com' in text):
|
||||
# Follows same logic as in users.py:message2/messagereply; TODO: unify?
|
||||
emit('speak', data)
|
||||
elif recipient:
|
||||
if user_ids_to_socket_ids.get(recipient):
|
||||
recipient_sid = user_ids_to_socket_ids[recipient]
|
||||
|
|
|
@ -453,9 +453,6 @@ def message2(v:User, username:str):
|
|||
|
||||
message = sanitize_raw_body(request.values.get("message"), False)
|
||||
if not message: abort(400, "Message is empty!")
|
||||
if 'linkedin.com' in message: abort(403, "This domain 'linkedin.com' is banned.")
|
||||
if v.id != AEVANN_ID and ('discord.gg' in message or 'discord.com/invite/' in message or 'discordapp.com/invite/' in message):
|
||||
abort(403, "Stop grooming!")
|
||||
|
||||
body_html = sanitize(message)
|
||||
|
||||
|
@ -507,11 +504,6 @@ def messagereply(v:User):
|
|||
body = sanitize_raw_body(request.values.get("body"), False)
|
||||
if not body and not request.files.get("file"): abort(400, "Message is empty!")
|
||||
|
||||
if 'linkedin.com' in body: abort(403, "This domain 'linkedin.com' is banned")
|
||||
|
||||
if v.id != AEVANN_ID and ('discord.gg' in body or 'discord.com/invite/' in body or 'discordapp.com/invite/' in body):
|
||||
abort(403, "Stop grooming!")
|
||||
|
||||
id = request.values.get("parent_id")
|
||||
parent = get_comment(id, v=v)
|
||||
user_id = parent.author.id
|
||||
|
|
Loading…
Reference in New Issue