From b608000544498efc7a032941d59a7f7b451676b7 Mon Sep 17 00:00:00 2001 From: Platonides Date: Fri, 28 May 2010 21:22:45 +0000 Subject: [PATCH] Bug 23699: Add trailing \n at the end of
s in wrapWikiMsg() Patch by Umherirrender --- includes/Article.php | 16 +++++++------- includes/EditPage.php | 22 +++++++++---------- includes/HistoryPage.php | 2 +- includes/ImagePage.php | 2 +- includes/OutputPage.php | 6 ++--- includes/SpecialPage.php | 2 +- includes/diff/DifferenceInterface.php | 8 +++---- includes/specials/SpecialBooksources.php | 2 +- includes/specials/SpecialConfirmemail.php | 2 +- includes/specials/SpecialImport.php | 6 ++--- includes/specials/SpecialMovepage.php | 2 +- includes/specials/SpecialPreferences.php | 4 ++-- .../specials/SpecialRecentchangeslinked.php | 2 +- includes/specials/SpecialRevisiondelete.php | 2 +- includes/specials/SpecialTags.php | 2 +- includes/specials/SpecialUndelete.php | 8 +++---- includes/upload/UploadBase.php | 2 +- 17 files changed, 45 insertions(+), 45 deletions(-) diff --git a/includes/Article.php b/includes/Article.php index 781a8f4baa..ab3e36c98b 100644 --- a/includes/Article.php +++ b/includes/Article.php @@ -1186,7 +1186,7 @@ class Article { if ( $this->mTitle->isTalkPage() ) { $msg = wfMsgNoTrans( 'talkpageheader' ); if ( $msg !== '-' && !wfEmptyMsg( 'talkpageheader', $msg ) ) { - $wgOut->wrapWikiMsg( "
\n$1
", array( 'talkpageheader' ) ); + $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'talkpageheader' ) ); } } } @@ -1259,7 +1259,7 @@ class Article { $user = User::newFromName( $rootPart, false /* allow IP users*/ ); $ip = User::isIP( $rootPart ); if ( !$user->isLoggedIn() && !$ip ) { # User does not exist - $wgOut->wrapWikiMsg( "
\n\$1
", + $wgOut->wrapWikiMsg( "
\n\$1\n
", array( 'userpage-userdoesnotexist-view', $rootPart ) ); } else if ( $user->isBlocked() ) { # Show log extract if the user is currently blocked LogEventsList::showLogExtract( @@ -1329,7 +1329,7 @@ class Article { } // If the user is not allowed to see it... if ( !$this->mRevision->userCan( Revision::DELETED_TEXT ) ) { - $wgOut->wrapWikiMsg( "\n", + $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-permission' ); return false; // If the user needs to confirm that they want to see it... @@ -1339,14 +1339,14 @@ class Article { $link = $this->mTitle->getFullUrl( "oldid={$oldid}&unhide=1" ); $msg = $this->mRevision->isDeleted( Revision::DELETED_RESTRICTED ) ? 'rev-suppressed-text-unhide' : 'rev-deleted-text-unhide'; - $wgOut->wrapWikiMsg( "\n", + $wgOut->wrapWikiMsg( "\n", array( $msg, $link ) ); return false; // We are allowed to see... } else { $msg = $this->mRevision->isDeleted( Revision::DELETED_RESTRICTED ) ? 'rev-suppressed-text-view' : 'rev-deleted-text-view'; - $wgOut->wrapWikiMsg( "\n", $msg ); + $wgOut->wrapWikiMsg( "\n", $msg ); return true; } } @@ -1513,7 +1513,7 @@ class Article { $o->tb_name, $rmvtxt ); } - $wgOut->wrapWikiMsg( "
$1
\n", array( 'trackbackbox', $tbtext ) ); + $wgOut->wrapWikiMsg( "
\n$1\n
\n", array( 'trackbackbox', $tbtext ) ); } /** @@ -2673,7 +2673,7 @@ class Article { $bigHistory = $this->isBigDeletion(); if ( $bigHistory && !$this->mTitle->userCan( 'bigdelete' ) ) { global $wgLang, $wgDeleteRevisionsLimit; - $wgOut->wrapWikiMsg( "
\n$1
\n", + $wgOut->wrapWikiMsg( "
\n$1\n
\n", array( 'delete-toobig', $wgLang->formatNum( $wgDeleteRevisionsLimit ) ) ); return; } @@ -2704,7 +2704,7 @@ class Article { ); if ( $bigHistory ) { global $wgDeleteRevisionsLimit; - $wgOut->wrapWikiMsg( "
\n$1
\n", + $wgOut->wrapWikiMsg( "
\n$1\n
\n", array( 'delete-warning-toobig', $wgLang->formatNum( $wgDeleteRevisionsLimit ) ) ); } } diff --git a/includes/EditPage.php b/includes/EditPage.php index ff57eb795d..1b91fe0d2f 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -690,7 +690,7 @@ class EditPage { if ( $namespace == NS_MEDIAWIKI ) { # Show a warning if editing an interface message - $wgOut->wrapWikiMsg( "
\n$1
", 'editinginterface' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'editinginterface' ); } # Show a warning message when someone creates/edits a user (talk) page but the user does not exist @@ -701,7 +701,7 @@ class EditPage { $user = User::newFromName( $username, false /* allow IP users*/ ); $ip = User::isIP( $username ); if ( !$user->isLoggedIn() && !$ip ) { # User does not exist - $wgOut->wrapWikiMsg( "
\n$1
", + $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'userpage-userdoesnotexist', $username ) ); } else if ( $user->isBlocked() ) { # Show log extract if the user is currently blocked LogEventsList::showLogExtract( @@ -723,9 +723,9 @@ class EditPage { # Try to add a custom edit intro, or use the standard one if this is not possible. if ( !$this->showCustomIntro() && !$this->mTitle->exists() ) { if ( $wgUser->isLoggedIn() ) { - $wgOut->wrapWikiMsg( "
\n$1
", 'newarticletext' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'newarticletext' ); } else { - $wgOut->wrapWikiMsg( "
\n$1
", 'newarticletextanon' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'newarticletextanon' ); } } # Give a notice if the user is editing a deleted/moved page... @@ -1234,7 +1234,7 @@ class EditPage { if ( $this->wasDeletedSinceLastEdit() && 'save' != $this->formtype ) { $wgOut->wrapWikiMsg( - "
\n$1
", + "
\n$1\n
", 'deletedwhileediting' ); } elseif ( $this->wasDeletedSinceLastEdit() ) { // Hide the toolbar and edit area, user can click preview to get it back @@ -1339,7 +1339,7 @@ HTML protected function showHeader() { global $wgOut, $wgUser, $wgTitle, $wgMaxArticleSize, $wgLang; if ( $this->isConflict ) { - $wgOut->wrapWikiMsg( "
\n$1
", 'explainconflict' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'explainconflict' ); $this->edittime = $this->mArticle->getTimestamp(); } else { if ( $this->section != '' && !$this->isSectionEditSupported() ) { @@ -1364,15 +1364,15 @@ HTML } if ( $this->missingComment ) { - $wgOut->wrapWikiMsg( "
\n$1
", 'missingcommenttext' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'missingcommenttext' ); } if ( $this->missingSummary && $this->section != 'new' ) { - $wgOut->wrapWikiMsg( "
\n$1
", 'missingsummary' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'missingsummary' ); } if ( $this->missingSummary && $this->section == 'new' ) { - $wgOut->wrapWikiMsg( "
\n$1
", 'missingcommentheader' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'missingcommentheader' ); } if ( $this->hookError !== '' ) { @@ -1387,9 +1387,9 @@ HTML // Let sysop know that this will make private content public if saved if ( !$this->mArticle->mRevision->userCan( Revision::DELETED_TEXT ) ) { - $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-permission' ); + $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-permission' ); } else if ( $this->mArticle->mRevision->isDeleted( Revision::DELETED_TEXT ) ) { - $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-view' ); + $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-view' ); } if ( !$this->mArticle->mRevision->isCurrent() ) { diff --git a/includes/HistoryPage.php b/includes/HistoryPage.php index 1b7ad22c0c..d80356ad96 100644 --- a/includes/HistoryPage.php +++ b/includes/HistoryPage.php @@ -374,7 +374,7 @@ class HistoryPager extends ReverseChronologicalPager { $this->counter = 1; $this->oldIdChecked = 0; - $wgOut->wrapWikiMsg( "
\n$1
", 'histlegend' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'histlegend' ); $s = Xml::openElement( 'form', array( 'action' => $wgScript, 'id' => 'mw-history-compare' ) ) . "\n"; $s .= Xml::hidden( 'title', $this->title->getPrefixedDbKey() ) . "\n"; diff --git a/includes/ImagePage.php b/includes/ImagePage.php index 613a36a697..bd9b2815a3 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -738,7 +738,7 @@ EOT global $wgUploadMaintenance; if ( $wgUploadMaintenance && $this->mTitle && $this->mTitle->getNamespace() == NS_FILE ) { global $wgOut; - $wgOut->wrapWikiMsg( "
\n$1
\n", array( 'filedelete-maintenance' ) ); + $wgOut->wrapWikiMsg( "
\n$1\n
\n", array( 'filedelete-maintenance' ) ); return; } diff --git a/includes/OutputPage.php b/includes/OutputPage.php index f8acd0b1aa..680b4c6f8c 100644 --- a/includes/OutputPage.php +++ b/includes/OutputPage.php @@ -1935,7 +1935,7 @@ class OutputPage { // Wiki is read only $this->setPageTitle( wfMsg( 'readonly' ) ); $reason = wfReadOnlyReason(); - $this->wrapWikiMsg( "
\n$1
", array( 'readonlytext', $reason ) ); + $this->wrapWikiMsg( "
\n$1\n
", array( 'readonlytext', $reason ) ); } // Show source, if supplied @@ -2590,11 +2590,11 @@ class OutputPage { * * For example: * - * $wgOut->wrapWikiMsg( "
\n$1
", 'some-error' ); + * $wgOut->wrapWikiMsg( "
\n$1\n
", 'some-error' ); * * Is equivalent to: * - * $wgOut->addWikiText( "
\n" . wfMsgNoTrans( 'some-error' ) . '
' ); + * $wgOut->addWikiText( "
\n" . wfMsgNoTrans( 'some-error' ) . "\n
" ); * * The newline after opening div is needed in some wikitext. See bug 19226. */ diff --git a/includes/SpecialPage.php b/includes/SpecialPage.php index bfd8bba8e8..dfe3506e83 100644 --- a/includes/SpecialPage.php +++ b/includes/SpecialPage.php @@ -832,7 +832,7 @@ Perhaps no page aliases are defined for it?" ); } $out = wfMsgNoTrans( $msg ); if ( ! wfEmptyMsg( $msg, $out ) and $out !== '' and ! $this->including() ) { - $wgOut->wrapWikiMsg( "
\n$1
", $msg ); + $wgOut->wrapWikiMsg( "
\n$1\n
", $msg ); } } diff --git a/includes/diff/DifferenceInterface.php b/includes/diff/DifferenceInterface.php index e0fe0ee45c..ed256e964c 100644 --- a/includes/diff/DifferenceInterface.php +++ b/includes/diff/DifferenceInterface.php @@ -353,7 +353,7 @@ CONTROL; if( !$allowed ) { $msg = $suppressed ? 'rev-suppressed-no-diff' : 'rev-deleted-no-diff'; # Give explanation for why revision is not visible - $wgOut->wrapWikiMsg( "\n", + $wgOut->wrapWikiMsg( "\n", array( $msg ) ); } else { # Give explanation and add a link to view the diff... @@ -363,7 +363,7 @@ CONTROL; 'unhide' => 1 ) ); $msg = $suppressed ? 'rev-suppressed-unhide-diff' : 'rev-deleted-unhide-diff'; - $wgOut->wrapWikiMsg( "\n", array( $msg, $link ) ); + $wgOut->wrapWikiMsg( "\n", array( $msg, $link ) ); } # Otherwise, output a regular diff... } else { @@ -416,9 +416,9 @@ CONTROL; $wgOut->addHTML( "

{$this->mPagetitle}

\n" ); # Add deleted rev tag if needed if( !$this->mNewRev->userCan(Revision::DELETED_TEXT) ) { - $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-permission' ); + $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-permission' ); } else if( $this->mNewRev->isDeleted(Revision::DELETED_TEXT) ) { - $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-view' ); + $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-view' ); } if( !$this->mNewRev->isCurrent() ) { diff --git a/includes/specials/SpecialBooksources.php b/includes/specials/SpecialBooksources.php index 8ee5467a31..94cfc8a795 100644 --- a/includes/specials/SpecialBooksources.php +++ b/includes/specials/SpecialBooksources.php @@ -35,7 +35,7 @@ class SpecialBookSources extends SpecialPage { $wgOut->addHTML( $this->makeForm() ); if( strlen( $this->isbn ) > 0 ) { if( !self::isValidISBN( $this->isbn ) ) { - $wgOut->wrapWikiMsg( "
\n$1
", 'booksources-invalid-isbn' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'booksources-invalid-isbn' ); } $this->showList(); } diff --git a/includes/specials/SpecialConfirmemail.php b/includes/specials/SpecialConfirmemail.php index 7a26d74cae..1c71abbc9f 100644 --- a/includes/specials/SpecialConfirmemail.php +++ b/includes/specials/SpecialConfirmemail.php @@ -77,7 +77,7 @@ class EmailConfirmation extends UnlistedSpecialPage { $wgOut->addWikiMsg( 'emailauthenticated', $time, $d, $t ); } if( $wgUser->isEmailConfirmationPending() ) { - $wgOut->wrapWikiMsg( "
\n$1
", 'confirmemail_pending' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'confirmemail_pending' ); } $wgOut->addWikiMsg( 'confirmemail_text' ); $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getTitle()->getLocalUrl() ) ); diff --git a/includes/specials/SpecialImport.php b/includes/specials/SpecialImport.php index 9d451f6788..d5d80df6b5 100644 --- a/includes/specials/SpecialImport.php +++ b/includes/specials/SpecialImport.php @@ -103,7 +103,7 @@ class SpecialImport extends SpecialPage { } if( WikiError::isError( $source ) ) { - $wgOut->wrapWikiMsg( '

$1

', array( 'importfailed', $source->getMessage() ) ); + $wgOut->wrapWikiMsg( "

\n$1\n

", array( 'importfailed', $source->getMessage() ) ); } else { $wgOut->addWikiMsg( "importstart" ); @@ -119,10 +119,10 @@ class SpecialImport extends SpecialPage { if( WikiError::isError( $result ) ) { # No source or XML parse error - $wgOut->wrapWikiMsg( '

$1

', array( 'importfailed', $result->getMessage() ) ); + $wgOut->wrapWikiMsg( "

\n$1\n

", array( 'importfailed', $result->getMessage() ) ); } elseif( WikiError::isError( $resultCount ) ) { # Zero revisions - $wgOut->wrapWikiMsg( '

$1

', array( 'importfailed', $resultCount->getMessage() ) ); + $wgOut->wrapWikiMsg( "

\n$1\n

", array( 'importfailed', $resultCount->getMessage() ) ); } else { # Success! $wgOut->addWikiMsg( 'importsuccess' ); diff --git a/includes/specials/SpecialMovepage.php b/includes/specials/SpecialMovepage.php index 02197b199c..9b480bbcb0 100644 --- a/includes/specials/SpecialMovepage.php +++ b/includes/specials/SpecialMovepage.php @@ -174,7 +174,7 @@ class MovePageForm { $errMsg = "

$hookErr

\n"; $wgOut->addHTML( $errMsg ); } else { - $wgOut->wrapWikiMsg( '

$1

', $err ); + $wgOut->wrapWikiMsg( "

\n$1\n

", $err ); } } diff --git a/includes/specials/SpecialPreferences.php b/includes/specials/SpecialPreferences.php index 4c8bbb09cd..bdc1ab2a7b 100644 --- a/includes/specials/SpecialPreferences.php +++ b/includes/specials/SpecialPreferences.php @@ -30,13 +30,13 @@ class SpecialPreferences extends SpecialPage { if ( $wgRequest->getCheck( 'success' ) ) { $wgOut->wrapWikiMsg( - '
$1
', + "
\n$1\n
", 'savedprefs' ); } if ( $wgRequest->getCheck( 'eauth' ) ) { - $wgOut->wrapWikiMsg( "
\n$1
", + $wgOut->wrapWikiMsg( "
\n$1\n
", 'eauthentsent', $wgUser->getName() ); } diff --git a/includes/specials/SpecialRecentchangeslinked.php b/includes/specials/SpecialRecentchangeslinked.php index 3b549843fe..029f8d47a4 100644 --- a/includes/specials/SpecialRecentchangeslinked.php +++ b/includes/specials/SpecialRecentchangeslinked.php @@ -52,7 +52,7 @@ class SpecialRecentchangeslinked extends SpecialRecentchanges { } $title = Title::newFromURL( $target ); if( !$title || $title->getInterwiki() != '' ){ - $wgOut->wrapWikiMsg( "
\n$1

", 'allpagesbadtitle' ); + $wgOut->wrapWikiMsg( "
\n$1\n

", 'allpagesbadtitle' ); return false; } diff --git a/includes/specials/SpecialRevisiondelete.php b/includes/specials/SpecialRevisiondelete.php index 4feebd5fbe..01403c0cd8 100644 --- a/includes/specials/SpecialRevisiondelete.php +++ b/includes/specials/SpecialRevisiondelete.php @@ -533,7 +533,7 @@ class SpecialRevisionDelete extends UnlistedSpecialPage { protected function success() { global $wgOut; $wgOut->setPagetitle( wfMsg( 'actioncomplete' ) ); - $wgOut->wrapWikiMsg( '$1', $this->typeInfo['success'] ); + $wgOut->wrapWikiMsg( "\n$1\n", $this->typeInfo['success'] ); $this->list->reloadFromMaster(); $this->showForm(); } diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index 57feeae7a3..8b731517ec 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -16,7 +16,7 @@ class SpecialTags extends SpecialPage { $sk = $wgUser->getSkin(); $wgOut->setPageTitle( wfMsg( 'tags-title' ) ); - $wgOut->wrapWikiMsg( "
\n$1
", 'tags-intro' ); + $wgOut->wrapWikiMsg( "
\n$1\n
", 'tags-intro' ); // Write the headers $html = ''; diff --git a/includes/specials/SpecialUndelete.php b/includes/specials/SpecialUndelete.php index b9b39073a4..87c1921fee 100644 --- a/includes/specials/SpecialUndelete.php +++ b/includes/specials/SpecialUndelete.php @@ -665,7 +665,7 @@ class UndeleteForm { if( $this->mRestore && $this->mAction == "submit" ) { global $wgUploadMaintenance; if( $wgUploadMaintenance && $this->mTargetObj && $this->mTargetObj->getNamespace() == NS_FILE ) { - $wgOut->wrapWikiMsg( "
\n$1
\n", array( 'filedelete-maintenance' ) ); + $wgOut->wrapWikiMsg( "
\n$1\n
\n", array( 'filedelete-maintenance' ) ); return; } return $this->undelete(); @@ -746,10 +746,10 @@ class UndeleteForm { if( $rev->isDeleted(Revision::DELETED_TEXT) ) { if( !$rev->userCan(Revision::DELETED_TEXT) ) { - $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-permission' ); + $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-permission' ); return; } else { - $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-view' ); + $wgOut->wrapWikiMsg( "\n", 'rev-deleted-text-view' ); $wgOut->addHTML( '
' ); // and we are allowed to see... } @@ -1001,7 +1001,7 @@ class UndeleteForm { $wgOut->setPagetitle( wfMsg( 'viewdeletedpage' ) ); } - $wgOut->wrapWikiMsg( "
\n$1
\n", array ( 'undeletepagetitle', $this->mTargetObj->getPrefixedText() ) ); + $wgOut->wrapWikiMsg( "
\n$1\n
\n", array ( 'undeletepagetitle', $this->mTargetObj->getPrefixedText() ) ); $archive = new PageArchive( $this->mTargetObj ); /* diff --git a/includes/upload/UploadBase.php b/includes/upload/UploadBase.php index d8a49a623c..e531012767 100644 --- a/includes/upload/UploadBase.php +++ b/includes/upload/UploadBase.php @@ -897,7 +897,7 @@ abstract class UploadBase { if ( !$wgAntivirusSetup[$wgAntivirus] ) { wfDebug( __METHOD__ . ": unknown virus scanner: $wgAntivirus\n" ); - $wgOut->wrapWikiMsg( "
\n$1
", + $wgOut->wrapWikiMsg( "
\n$1\n
", array( 'virus-badscanner', $wgAntivirus ) ); return wfMsg( 'virus-unknownscanner' ) . " $wgAntivirus"; } -- 2.20.1