Fix web push notifications containing HTML entities (#18071)

lolsob-rspec
Claire 2022-04-23 21:47:43 +02:00 committed by GitHub
parent 4af30ac16b
commit bf3efdbb2d
1 changed files with 1 additions and 1 deletions

View File

@ -34,6 +34,6 @@ class Web::NotificationSerializer < ActiveModel::Serializer
def body def body
str = strip_tags(object.target_status&.spoiler_text&.presence || object.target_status&.text || object.from_account.note) 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
end end