Fix banned text being able to be circumvented via unicode (#35978)
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user