Parcourir la source

Handle blank poll options more gracefully (#10946)

Pleroma currently allows (erroneously imho) empty poll options, that is,
options with an empty (but existing) `name`.
master^2
ThibG il y a 5 ans
committed by Eugen Rochko
Parent
révision
3a84bacf86
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. +1
    -1
      app/lib/activitypub/activity/create.rb

+ 1
- 1
app/lib/activitypub/activity/create.rb Voir le fichier

@@ -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


Chargement…
Annuler
Enregistrer