From: Fomafix Date: Sat, 8 Aug 2015 20:57:25 +0000 (+0000) Subject: wikibits.js: Support multiple parameter in document.write X-Git-Tag: 1.31.0-rc.0~10452^2 X-Git-Url: https://git.cyclocoop.org/%27.WWW_URL.%27admin/?a=commitdiff_plain;h=b7ec9cb7f6fea4a59ed8040331d5417fe7b5b010;p=lhc%2Fweb%2Fwiklou.git wikibits.js: Support multiple parameter in document.write document.write and document.writeln supports multiple arguments: http://www.w3.org/html/wg/drafts/html/CR/webappapis.html#document.write%28%29 Support this in the replacement code. Change-Id: I0ffc51352278d434d8347502c778b16b34c7d73f --- diff --git a/resources/src/mediawiki.legacy/wikibits.js b/resources/src/mediawiki.legacy/wikibits.js index 05954ffcfc..b5720a4464 100644 --- a/resources/src/mediawiki.legacy/wikibits.js +++ b/resources/src/mediawiki.legacy/wikibits.js @@ -218,8 +218,8 @@ // Replace document.write/writeln with basic html parsing that appends // to the to avoid blanking pages. Added JavaScript will not run. $.each( [ 'write', 'writeln' ], function ( idx, method ) { - mw.log.deprecate( document, method, function ( html ) { - $( 'body' ).append( $.parseHTML( html ) ); + mw.log.deprecate( document, method, function () { + $( 'body' ).append( $.parseHTML( Array.prototype.join.call( arguments, '' ) ) ); }, 'Use jQuery or mw.loader.load instead.' ); } );