Skip to content
Snippets Groups Projects
Commit 9b6223f5 authored by abcang's avatar abcang Committed by Eugen Rochko
Browse files

Validation of count works even when text of status is nil (#6429)

parent 3f35d432
No related branches found
No related tags found
No related merge requests found
......@@ -23,6 +23,8 @@ class StatusLengthValidator < ActiveModel::Validator
end
def countable_text(status)
return '' if status.text.nil?
status.text.dup.tap do |new_text|
new_text.gsub!(FetchLinkCardService::URL_PATTERN, 'x' * 23)
new_text.gsub!(Account::MENTION_RE, '@\2')
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment