mirror of
https://github.com/mastodon/mastodon.git
synced 2024-11-21 12:05:07 +01:00
Fix web push notifications containing HTML entities (#18071)
This commit is contained in:
parent
ea38327816
commit
8ffa96b059
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user