mirror of
https://github.com/TeamPiped/Piped-Backend.git
synced 2025-04-29 16:30:29 +05:30
Don't escape entire HTML, just the URL.
This commit is contained in:
parent
3cae269adb
commit
c2a93d5354
@ -278,11 +278,11 @@ public class FeedHandlers {
|
|||||||
entries.add(entry);
|
entries.add(entry);
|
||||||
|
|
||||||
if (filtered.size() == 1) {
|
if (filtered.size() == 1) {
|
||||||
feed.setTitle(channel.getUploader());
|
feed.setTitle("Piped - " + channel.getUploader());
|
||||||
SyndImage channelIcon = new SyndImageImpl();
|
SyndImage channelIcon = new SyndImageImpl();
|
||||||
channelIcon.setLink(Constants.FRONTEND_URL + "/channel/" + channel.getUploaderId());
|
channelIcon.setLink(Constants.FRONTEND_URL + "/channel/" + channel.getUploaderId());
|
||||||
channelIcon.setTitle(channel.getUploader());
|
channelIcon.setTitle(channel.getUploader());
|
||||||
channelIcon.setUrl(channel.getUploaderAvatar());
|
channelIcon.setUrl(rewriteURL(channel.getUploaderAvatar()));
|
||||||
feed.setIcon(channelIcon);
|
feed.setIcon(channelIcon);
|
||||||
feed.setImage(channelIcon);
|
feed.setImage(channelIcon);
|
||||||
}
|
}
|
||||||
|
@ -16,6 +16,8 @@ import java.util.Collections;
|
|||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import static me.kavin.piped.utils.URLUtils.rewriteURL;
|
||||||
|
|
||||||
public class ChannelHelpers {
|
public class ChannelHelpers {
|
||||||
|
|
||||||
public static boolean isValidId(String id) {
|
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());
|
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);
|
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>",
|
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()
|
Constants.FRONTEND_URL + "/watch?v=" + video.getId(),
|
||||||
, video.getThumbnail()
|
StringEscapeUtils.escapeXml11(rewriteURL(video.getThumbnail()))
|
||||||
)
|
);
|
||||||
);
|
|
||||||
thumbnail.setType("xhtml");
|
thumbnail.setType("xhtml");
|
||||||
thumbnail.setValue(thumbnailContent);
|
thumbnail.setValue(thumbnailContent);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user