Merged v5.12.4 into main

v5.12.4
This commit is contained in:
Daniel Lockyer 2022-09-02 15:13:37 +01:00
commit dd2bfb8c0e
No known key found for this signature in database
GPG Key ID: D21186F0B47295AD
4 changed files with 8 additions and 5 deletions

View File

@ -1,6 +1,6 @@
{
"name": "ghost-admin",
"version": "5.12.3",
"version": "5.12.4",
"description": "Ember.js admin client for Ghost",
"author": "Ghost Foundation",
"homepage": "http://ghost.org",

View File

@ -28,9 +28,10 @@ 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, ['title', 'excerpt', 'html', 'feature_image_alt', 'feature_image_caption']);
const cleanPost = sanitizeKeys(post, ['title', 'excerpt', 'authors', 'feature_image_alt', 'feature_image_caption']);
const cleanSite = sanitizeKeys(site, ['title']);
const cleanNewsletter = sanitizeKeys(newsletter, ['name']);
return `<!doctype html>
<html>

View File

@ -1,6 +1,6 @@
{
"name": "ghost",
"version": "5.12.3",
"version": "5.12.4",
"description": "The professional publishing platform",
"author": "Ghost Foundation",
"homepage": "https://ghost.org",

View File

@ -120,9 +120,11 @@ describe('Mega template', function () {
});
it('Correctly escapes the contents', function () {
// TODO: check html escaping based on mobiledoc instead of invalid html: https://github.com/TryGhost/Team/issues/1871
const post = {
title: 'I <3 Posts',
html: '<div class="post-content-html">I am <100 years old</div>',
html: '<div class="post-content-html">I am &lt;100 years old</div>',
feature_image: 'https://example.com/image.jpg',
feature_image_alt: 'I <3 alt text',
feature_image_caption: 'I <3 images'
@ -196,7 +198,7 @@ describe('Mega template', function () {
should(html).containEql('class="custom"');
// note that some part of rendering/sanitisation removes spaces from the style description
should(html).containEql('style="font-weight:900;display:flex"');
should(html).containEql('style="font-weight: 900; display: flex;"');
});
it('Uses the post title as a fallback for the excerpt', function () {