about summary refs log tree commit diff
path: root/app
diff options
context:
space:
mode:
authorEugen Rochko <eugen@zeonfederated.com>2018-05-22 18:12:45 +0200
committerGitHub <noreply@github.com>2018-05-22 18:12:45 +0200
commit1a564df586acc4554bba7e3200ced5bcf2ea017e (patch)
tree00371b33b098195803cabc887b8b47aaeb2c3976 /app
parent4c9d5a500d59d2a440f61167e6552ede29033bae (diff)
Do not encode HTML entities in initial Web Push payload body (#7592)
Diffstat (limited to 'app')
-rw-r--r--app/serializers/web/notification_serializer.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/app/serializers/web/notification_serializer.rb b/app/serializers/web/notification_serializer.rb
index f3c4ffc47..43ba4d92a 100644
--- a/app/serializers/web/notification_serializer.rb
+++ b/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