From b993218939b5b4e41ea68ed2127c724c18a7bb40 Mon Sep 17 00:00:00 2001 From: "C. Scott Ananian" Date: Thu, 27 Sep 2018 10:16:53 -0400 Subject: [PATCH] Special:Import - wrap error messages with
not

Localized messages are wikitext and can contain `

` or `\n\n` which would break `

` wrappers. Be consistent with the rest of the codebase and use `

` wrappers here. Bug: T205624 Change-Id: I1e8ff5985f3a7780ad9ba063827c515e997cb508 --- includes/specials/SpecialImport.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 3ef64f881f..153b7d1e2b 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -179,8 +179,8 @@ class SpecialImport extends SpecialPage { $out = $this->getOutput(); if ( !$source->isGood() ) { - $out->addWikiText( "

\n" . - $this->msg( 'importfailed', $source->getWikiText() )->parse() . "\n

" ); + $out->addWikiText( "
\n" . + $this->msg( 'importfailed', $source->getWikiText() )->parse() . "\n
" ); } else { $importer = new WikiImporter( $source->value, $this->getConfig() ); if ( !is_null( $this->namespace ) ) { @@ -189,7 +189,7 @@ class SpecialImport extends SpecialPage { $statusRootPage = $importer->setTargetRootPage( $this->rootpage ); if ( !$statusRootPage->isGood() ) { $out->wrapWikiMsg( - "

\n$1\n

", + "
\n$1\n
", [ 'import-options-wrong', $statusRootPage->getWikiText(), @@ -224,13 +224,13 @@ class SpecialImport extends SpecialPage { if ( $exception ) { # No source or XML parse error $out->wrapWikiMsg( - "

\n$1\n

", + "
\n$1\n
", [ 'importfailed', $exception->getMessage() ] ); } elseif ( !$result->isGood() ) { # Zero revisions $out->wrapWikiMsg( - "

\n$1\n

", + "
\n$1\n
", [ 'importfailed', $result->getWikiText() ] ); } else { -- 2.20.1