mirror of
				https://github.com/TeamPiped/Piped-Backend.git
				synced 2024-08-14 23:51:41 +00:00 
			
		
		
		
	Merge pull request #504 from TeamPiped/feeds-encoding
Don't escape entire HTML, just the URL.
This commit is contained in:
		
						commit
						5236c9a3cb
					
				
					 2 changed files with 8 additions and 7 deletions
				
			
		| 
						 | 
				
			
			@ -278,11 +278,11 @@ public class FeedHandlers {
 | 
			
		|||
                entries.add(entry);
 | 
			
		||||
 | 
			
		||||
                if (filtered.size() == 1) {
 | 
			
		||||
                    feed.setTitle(channel.getUploader());
 | 
			
		||||
                    feed.setTitle("Piped - " + channel.getUploader());
 | 
			
		||||
                    SyndImage channelIcon = new SyndImageImpl();
 | 
			
		||||
                    channelIcon.setLink(Constants.FRONTEND_URL + "/channel/" + channel.getUploaderId());
 | 
			
		||||
                    channelIcon.setTitle(channel.getUploader());
 | 
			
		||||
                    channelIcon.setUrl(channel.getUploaderAvatar());
 | 
			
		||||
                    channelIcon.setUrl(rewriteURL(channel.getUploaderAvatar()));
 | 
			
		||||
                    feed.setIcon(channelIcon);
 | 
			
		||||
                    feed.setImage(channelIcon);
 | 
			
		||||
                }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -16,6 +16,8 @@ import java.util.Collections;
 | 
			
		|||
import java.util.Date;
 | 
			
		||||
import java.util.List;
 | 
			
		||||
 | 
			
		||||
import static me.kavin.piped.utils.URLUtils.rewriteURL;
 | 
			
		||||
 | 
			
		||||
public class ChannelHelpers {
 | 
			
		||||
 | 
			
		||||
    public static boolean isValidId(String id) {
 | 
			
		||||
| 
						 | 
				
			
			@ -82,12 +84,11 @@ public class ChannelHelpers {
 | 
			
		|||
        String contentText = String.format("Title: %s\nViews: %d\nId: %s\nDuration: %d\nIs YT Shorts: %b", video.getTitle(), video.getViews(), video.getId(), video.getDuration(), video.isShort());
 | 
			
		||||
        content.setValue(contentText);
 | 
			
		||||
 | 
			
		||||
        String thumbnailContent = StringEscapeUtils.escapeXml11(
 | 
			
		||||
        String thumbnailContent =
 | 
			
		||||
                String.format("<div xmlns=\"http://www.w3.org/1999/xhtml\"><a href=\"%s\"><img src=\"%s\"/></a></div>",
 | 
			
		||||
                        Constants.FRONTEND_URL + "/watch?v=" + video.getId()
 | 
			
		||||
                        , video.getThumbnail()
 | 
			
		||||
                )
 | 
			
		||||
        );
 | 
			
		||||
                        Constants.FRONTEND_URL + "/watch?v=" + video.getId(),
 | 
			
		||||
                        StringEscapeUtils.escapeXml11(rewriteURL(video.getThumbnail()))
 | 
			
		||||
                );
 | 
			
		||||
        thumbnail.setType("xhtml");
 | 
			
		||||
        thumbnail.setValue(thumbnailContent);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue