Handle blank poll options more gracefully (#10946)

Pleroma currently allows (erroneously imho) empty poll options, that is,
options with an empty (but existing) `name`.
lolsob-rspec
ThibG 2019-06-03 20:04:00 +02:00 committed by Eugen Rochko
parent 1f83cdf4fe
commit c45a330824
1 changed files with 1 additions and 1 deletions

View File

@ -234,7 +234,7 @@ class ActivityPub::Activity::Create < ActivityPub::Activity
@account.polls.new(
multiple: multiple,
expires_at: expires_at,
options: items.map { |item| item['name'].presence || item['content'] },
options: items.map { |item| item['name'].presence || item['content'] }.compact,
cached_tallies: items.map { |item| item.dig('replies', 'totalItems') || 0 }
)
end