2
0

Fix banned text being able to be circumvented via unicode (#35978)

This commit is contained in:
Eugen Rochko
2025-09-02 09:29:03 +02:00
committed by GitHub
parent 6e09dd10a7
commit 7fc884ba00
3 changed files with 55 additions and 24 deletions

View File

@@ -39,8 +39,6 @@ class PostStatusService < BaseService
@in_reply_to = @options[:thread]
@quoted_status = @options[:quoted_status]
@antispam = Antispam.new
return idempotency_duplicate if idempotency_given? && idempotency_duplicate?
validate_media!
@@ -82,7 +80,9 @@ class PostStatusService < BaseService
process_mentions_service.call(@status, save_records: false)
safeguard_mentions!(@status)
attach_quote!(@status)
@antispam.local_preflight_check!(@status)
antispam = Antispam.new(@status)
antispam.local_preflight_check!
# The following transaction block is needed to wrap the UPDATEs to
# the media attachments when the status is created
@@ -113,7 +113,9 @@ class PostStatusService < BaseService
def schedule_status!
status_for_validation = @account.statuses.build(status_attributes)
@antispam.local_preflight_check!(status_for_validation)
antispam = Antispam.new(status_for_validation)
antispam.local_preflight_check!
if status_for_validation.valid?
# Marking the status as destroyed is necessary to prevent the status from being