Fix URL scanning in note length validator and preview card fetching (#15827)
* Add tests * Fix URL scanning in note length validator and preview card fetching
This commit is contained in:
@ -15,7 +15,7 @@ class NoteLengthValidator < ActiveModel::EachValidator
|
||||
return '' if value.nil?
|
||||
|
||||
value.dup.tap do |new_text|
|
||||
new_text.gsub!(FetchLinkCardService::URL_PATTERN, 'x' * 23)
|
||||
new_text.gsub!(FetchLinkCardService::URL_PATTERN, StatusLengthValidator::URL_PLACEHOLDER)
|
||||
new_text.gsub!(Account::MENTION_RE, '@\2')
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user