]> cat aescling's git repositories - mastodon.git/commitdiff
Fix returning empty `<p>` tag for blank account `note` in REST API (#17687)
authorEugen Rochko <eugen@zeonfederated.com>
Thu, 3 Mar 2022 05:45:46 +0000 (06:45 +0100)
committerGitHub <noreply@github.com>
Thu, 3 Mar 2022 05:45:46 +0000 (06:45 +0100)
app/lib/formatter.rb

index 6f02d669ac731e35ca6df01cd37cb248576bf8d2..b6a13163d5ecc3c12cf4c4deab815db18e7ec953 100644 (file)
@@ -57,6 +57,8 @@ class Formatter
   end
 
   def simplified_format(account, **options)
+    return '' if account.note.blank?
+
     html = account.local? ? linkify(account.note) : reformat(account.note)
     html = encode_custom_emojis(html, account.emojis, options[:autoplay]) if options[:custom_emojify]
     html.html_safe # rubocop:disable Rails/OutputSafety