Fix style

This commit is contained in:
noellabo 2024-02-17 01:30:25 +09:00
parent 53ca4bd676
commit 67b6af0f8b
2 changed files with 7 additions and 9 deletions

View File

@ -46,10 +46,6 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
)
end
def reject_pattern?
Setting.reject_pattern.present? && @object['content']&.match?(Setting.reject_pattern)
end
def create_status
return reject_payload! if unsupported_object_type? || non_matching_uri_hosts?(@account.uri, object_uri) || tombstone_exists? || !related_to_local_activity? || reject_pattern?
@ -417,6 +413,10 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
Tombstone.exists?(uri: object_uri)
end
def reject_pattern?
Setting.reject_pattern.present? && @object['content']&.match?(Setting.reject_pattern)
end
def forward_for_reply
return unless @status.distributable? && @json['signature'].present? && reply_to_local?

View File

@ -4,10 +4,8 @@ class RegexpSyntaxValidator < ActiveModel::EachValidator
def validate_each(record, attribute, value)
return if value.blank?
begin
Regexp.compile(value)
rescue RegexpError => e
record.errors.add(attribute, I18n.t('applications.invalid_regexp', message: e.message))
end
Regexp.compile(value)
rescue RegexpError => e
record.errors.add(attribute, I18n.t('applications.invalid_regexp', message: e.message))
end
end