about summary refs log tree commit diff
diff options
context:
space:
mode:
authorThibG <thib@sitedethib.com>2019-06-03 20:04:00 +0200
committerEugen Rochko <eugen@zeonfederated.com>2019-06-03 20:04:00 +0200
commit3a84bacf8681669ea6149a153d6b419422eae259 (patch)
treec2f7bb6c8918846d4a0fb8849393cb31a86f8dfb
parent8bd2e4403ea8c95a17687046f0ec9cf175fc2576 (diff)
Handle blank poll options more gracefully (#10946)
Pleroma currently allows (erroneously imho) empty poll options, that is,
options with an empty (but existing) `name`.
-rw-r--r--app/lib/activitypub/activity/create.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/lib/activitypub/activity/create.rb b/app/lib/activitypub/activity/create.rb
index 2bc33c04b..f55dd35b2 100644
--- a/app/lib/activitypub/activity/create.rb
+++ b/app/lib/activitypub/activity/create.rb
@@ -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