Browse Source

Do not encode HTML entities in initial Web Push payload body (#7592)

custom
Eugen Rochko 4 years ago
committed by GitHub
parent
commit
1a564df586
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      app/serializers/web/notification_serializer.rb

3
app/serializers/web/notification_serializer.rb

@ -33,6 +33,7 @@ class Web::NotificationSerializer < ActiveModel::Serializer
end
def body
truncate(strip_tags(object.target_status&.spoiler_text&.presence || object.target_status&.text || object.from_account.note), length: 140)
str = truncate(strip_tags(object.target_status&.spoiler_text&.presence || object.target_status&.text || object.from_account.note), length: 140)
HTMLEntities.new.decode(str.to_str) # Do not encode entities, since this value will not be used in HTML
end
end

Loading…
Cancel
Save