From fff25694bbd139159ee2a2cb3a5f1b93877a2751 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gerg=C5=91=20Tisza?= Date: Tue, 25 Mar 2014 22:18:15 +0000 Subject: [PATCH] Sanitize embed HTML Make sure tables, lists and other complex stuff do not get into the embed HTML code. Change-Id: I559dc7892e058e403ddde6994a7e1ac0c9585325 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/369 --- resources/mmv/mmv.EmbedFileFormatter.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/resources/mmv/mmv.EmbedFileFormatter.js b/resources/mmv/mmv.EmbedFileFormatter.js index 918169089..93766e3a3 100644 --- a/resources/mmv/mmv.EmbedFileFormatter.js +++ b/resources/mmv/mmv.EmbedFileFormatter.js @@ -76,6 +76,9 @@ * @return {string} byline (can contain HTML) */ EFFP.getByline = function ( author, source ) { + author = author && this.htmlUtils.htmlToTextWithLinks( author ); + source = source && this.htmlUtils.htmlToTextWithLinks( source ); + if ( author && source) { return mw.message( 'multimediaviewer-credit',