Do not encode HTML entities in initial Web Push payload body (#7592)
This commit is contained in:
		
							parent
							
								
									4c9d5a500d
								
							
						
					
					
						commit
						1a564df586
					
				
					 1 changed files with 2 additions and 1 deletions
				
			
		| 
						 | 
					@ -33,6 +33,7 @@ class Web::NotificationSerializer < ActiveModel::Serializer
 | 
				
			||||||
  end
 | 
					  end
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  def body
 | 
					  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
 | 
				
			||||||
end
 | 
					end
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		
		Reference in a new issue