about summary refs log tree commit diff
path: root/app/serializers
diff options
context:
space:
mode:
authorClaire <claire.github-309c@sitedethib.com>2022-04-23 21:47:43 +0200
committerGitHub <noreply@github.com>2022-04-23 21:47:43 +0200
commit8ffa96b0595958e35ed44308a6801d3ea3160968 (patch)
tree27f6078886a219eb9d1bb82d257e9413d1119654 /app/serializers
parentea383278160bcee81477e86a95107d4a2dc315ef (diff)
Fix web push notifications containing HTML entities (#18071)
Diffstat (limited to 'app/serializers')
-rw-r--r--app/serializers/web/notification_serializer.rb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/serializers/web/notification_serializer.rb b/app/serializers/web/notification_serializer.rb
index ee83ec8b2..c5a908b19 100644
--- a/app/serializers/web/notification_serializer.rb
+++ b/app/serializers/web/notification_serializer.rb
@@ -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