logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 9b6223f5e26ed53f285a95921e9c660e831a7f6d
parent: 3f35d4322266ee6f1bfab73a1161af2b0848573a
Author: abcang <abcang1015@gmail.com>
Date:   Sun,  4 Feb 2018 20:32:41 +0900

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


Diffstat:

Mapp/validators/status_length_validator.rb2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/app/validators/status_length_validator.rb b/app/validators/status_length_validator.rb @@ -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')