diff --git a/core/server/data/meta/schema.js b/core/server/data/meta/schema.js index 55fa0f30cb..4aad9067ee 100644 --- a/core/server/data/meta/schema.js +++ b/core/server/data/meta/schema.js @@ -41,7 +41,7 @@ function trimSameAs(data, context) { if (context === 'post') { if (data.post.author.website) { - sameAs.push(data.post.author.website); + sameAs.push(escapeExpression(data.post.author.website)); } if (data.post.author.facebook) { sameAs.push(socialUrls.facebookUrl(data.post.author.facebook)); @@ -51,7 +51,7 @@ function trimSameAs(data, context) { } } else if (context === 'author') { if (data.author.website) { - sameAs.push(data.author.website); + sameAs.push(escapeExpression(data.author.website)); } if (data.author.facebook) { sameAs.push(socialUrls.facebookUrl(data.author.facebook)); diff --git a/core/test/unit/metadata/schema_spec.js b/core/test/unit/metadata/schema_spec.js index 1b2d93e6b1..233fce07ca 100644 --- a/core/test/unit/metadata/schema_spec.js +++ b/core/test/unit/metadata/schema_spec.js @@ -437,7 +437,7 @@ describe('getSchema', function () { context: ['author'], author: { name: 'Author Name', - website: 'http://myblogsite.com/', + website: 'http://myblogsite.com/?user=bambedibu&a=', twitter: '@testuser' } }, schema = getSchema(metadata, data); @@ -452,7 +452,7 @@ describe('getSchema', function () { }, name: 'Author Name', sameAs: [ - 'http://myblogsite.com/', + 'http://myblogsite.com/?user=bambedibu&a=<script>alert("bambedibu")</script>', 'https://twitter.com/testuser' ], url: 'http://mysite.com/author/me/'