diff --git a/ghost/core/test/e2e-api/admin/__snapshots__/mentions.test.js.snap b/ghost/core/test/e2e-api/admin/__snapshots__/mentions.test.js.snap index d7be69a6e5..afa69aebcf 100644 --- a/ghost/core/test/e2e-api/admin/__snapshots__/mentions.test.js.snap +++ b/ghost/core/test/e2e-api/admin/__snapshots__/mentions.test.js.snap @@ -12,7 +12,7 @@ Object { "source_excerpt": null, "source_favicon": null, "source_featured_image": null, - "source_site_title": null, + "source_site_title": "source.com", "source_title": Any, "target": Any, "timestamp": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, @@ -27,7 +27,7 @@ Object { "source_excerpt": null, "source_favicon": null, "source_featured_image": null, - "source_site_title": null, + "source_site_title": "anothersource.com", "source_title": Any, "target": Any, "timestamp": StringMatching /\\\\d\\{4\\}-\\\\d\\{2\\}-\\\\d\\{2\\}T\\\\d\\{2\\}:\\\\d\\{2\\}:\\\\d\\{2\\}\\\\\\.000Z/, diff --git a/ghost/webmentions/lib/Mention.js b/ghost/webmentions/lib/Mention.js index 26e5cd031c..8ab6a8ff5a 100644 --- a/ghost/webmentions/lib/Mention.js +++ b/ghost/webmentions/lib/Mention.js @@ -112,7 +112,11 @@ module.exports = class Mention { /** @type {string | null} */ const sourceExcerpt = validateString(metadata.sourceExcerpt, 2000, 'sourceExcerpt'); /** @type {string | null} */ - const sourceSiteTitle = validateString(metadata.sourceSiteTitle, 2000, 'sourceSiteTitle'); + let sourceSiteTitle = validateString(metadata.sourceSiteTitle, 2000, 'sourceSiteTitle'); + if (sourceSiteTitle === null) { + sourceSiteTitle = this.#source.host; + } + /** @type {string | null} */ const sourceAuthor = validateString(metadata.sourceAuthor, 2000, 'sourceAuthor');