Browse Source

Fix web push notifications containing HTML entities (#18071)

closed-social-glitch-2
Claire 2 years ago
committed by GitHub
parent
commit
8ffa96b059
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions
  1. +1
    -1
      app/serializers/web/notification_serializer.rb

+ 1
- 1
app/serializers/web/notification_serializer.rb View File

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

Loading…
Cancel
Save