Skip to content

Commit

Permalink
Merge pull request #130 from jarylc/xml-sitemap-escape
Browse files Browse the repository at this point in the history
Add missing title XML escapes for video sitemap element
  • Loading branch information
wenbinf committed Apr 19, 2024
2 parents 438b68a + 010fe65 commit 170ad3a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions edge-src/common/PageUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import ReactDOMServer from "react-dom/server";
import Theme from "../models/Theme";
import FeedDb, {getFetchItemsParams} from "../models/FeedDb";
import {CODE_TYPES, STATUSES} from "../../common-src/Constants";
import {ADMIN_URLS, urlJoinWithRelative} from "../../common-src/StringUtils";
import {ADMIN_URLS, escapeHtml, urlJoinWithRelative} from "../../common-src/StringUtils";
import OnboardingChecker from "../../common-src/OnboardingUtils";

export function renderReactToHtml(Component) {
Expand Down Expand Up @@ -177,7 +177,7 @@ export class SitemapResponseBuilder extends ResponseBuilder {
if (attachment.mime_type.startsWith('image/')) {
xml += `<image:image><image:loc>${attachment.url}</image:loc></image:image>`
} else if (attachment.mime_type.startsWith('video/')) {
xml += `<video:video><video:title>${item.title}</video:title><video:publication_date>${item.date_published}</video:publication_date><video:content_loc>${attachment.url}</video:content_loc></video:video>`
xml += `<video:video><video:title>${escapeHtml(item.title)}</video:title><video:publication_date>${item.date_published}</video:publication_date><video:content_loc>${attachment.url}</video:content_loc></video:video>`
}
})
}
Expand Down

0 comments on commit 170ad3a

Please sign in to comment.