diff --git a/ghost/core/core/server/services/mega/template.js b/ghost/core/core/server/services/mega/template.js index e0c7fb8127..42d6635e26 100644 --- a/ghost/core/core/server/services/mega/template.js +++ b/ghost/core/core/server/services/mega/template.js @@ -26,7 +26,7 @@ const sanitizeKeys = (obj, keys) => { module.exports = ({post, site, newsletter, templateSettings}) => { const date = new Date(); const hasFeatureImageCaption = templateSettings.showFeatureImage && post.feature_image && post.feature_image_caption; - const cleanPost = sanitizeKeys(post, ['url', 'published_at', 'title', 'excerpt', 'authors', 'feature_image', 'feature_image_alt', 'feature_image_caption']); + const cleanPost = sanitizeKeys(post, ['url', 'published_at', 'title', 'excerpt', 'authors', 'feature_image', 'feature_image_alt']); const cleanSite = sanitizeKeys(site, ['title']); const cleanNewsletter = sanitizeKeys(newsletter, ['name']); diff --git a/ghost/core/test/unit/server/services/mega/post-email-serializer.test.js b/ghost/core/test/unit/server/services/mega/post-email-serializer.test.js index b0cb3c2932..fa0865a7bd 100644 --- a/ghost/core/test/unit/server/services/mega/post-email-serializer.test.js +++ b/ghost/core/test/unit/server/services/mega/post-email-serializer.test.js @@ -51,7 +51,7 @@ describe('Post Email Serializer', function () { excerpt: 'This is a blog post test <3', authors: 'This is a blog post test <3', feature_image_alt: 'This is a blog post test <3', - feature_image_caption: 'This is a blog post test <3', + feature_image_caption: 'This is escaped in the frontend', // This is a markdown post with all cards that contain <3 in all fields + tags // Note that some fields are already escaped in the frontend diff --git a/ghost/core/test/unit/server/services/mega/template.test.js b/ghost/core/test/unit/server/services/mega/template.test.js index 1b20a14bb6..7fccfbab0b 100644 --- a/ghost/core/test/unit/server/services/mega/template.test.js +++ b/ghost/core/test/unit/server/services/mega/template.test.js @@ -125,7 +125,7 @@ describe('Mega template', function () { html: '
I am <100 years old
', feature_image: 'https://example.com/image.jpg', feature_image_alt: 'I <3 alt text', - feature_image_caption: 'I <3 images' + feature_image_caption: 'I <3 images' // escaped in frontend }; const site = { iconUrl: 'site icon url',