From e5b32029d0393d5044b40792985429eec8a37f76 Mon Sep 17 00:00:00 2001 From: Fomafix Date: Tue, 19 Apr 2016 16:32:50 +0000 Subject: [PATCH] Special:Upload: Use user interface language for error message This change adds the parameters errorformat=html and errorlang with the user interface language code to the API request. Bug: T133059 Change-Id: I75b3c9537a8805367d36a4e51453a9f9219c9555 --- resources/src/mediawiki.special/mediawiki.special.upload.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/resources/src/mediawiki.special/mediawiki.special.upload.js b/resources/src/mediawiki.special/mediawiki.special.upload.js index 5934278330..9bf62558dd 100644 --- a/resources/src/mediawiki.special/mediawiki.special.upload.js +++ b/resources/src/mediawiki.special/mediawiki.special.upload.js @@ -73,7 +73,9 @@ // If title is empty, user input is invalid, the API call will produce details about why titles: title ? title.getPrefixedText() : this.nameToCheck, prop: 'imageinfo', - iiprop: 'uploadwarning' + iiprop: 'uploadwarning', + errorformat: 'html', + errorlang: mw.config.get( 'wgUserLanguage' ) } ).done( function ( result ) { var resultOut = '', @@ -81,7 +83,7 @@ if ( page.imageinfo ) { resultOut = page.imageinfo[ 0 ].html; } else if ( page.invalidreason ) { - resultOut = mw.html.escape( page.invalidreason ); + resultOut = page.invalidreason.html; } uploadWarning.processResult( resultOut, uploadWarning.nameToCheck ); } ).always( function () { -- 2.20.1