From: jenkins-bot Date: Thu, 1 Nov 2018 17:20:45 +0000 (+0000) Subject: Merge "Replace deprecated calls to OutputPage::parse()" X-Git-Tag: 1.34.0-rc.0~3584 X-Git-Url: http://git.heureux-cyclage.org/?a=commitdiff_plain;h=4732f11a5d4b75616150e36a2c24ccaffc89c265;hp=ea6552ac838d1969404f91b203f342021aa21e39;p=lhc%2Fweb%2Fwiklou.git Merge "Replace deprecated calls to OutputPage::parse()" --- diff --git a/includes/EditPage.php b/includes/EditPage.php index a79b974ed8..632b38d78c 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -1302,8 +1302,12 @@ class EditPage { // Messages: undo-success, undo-failure, undo-main-slot-only, undo-norev, // undo-nochange. $class = ( $undoMsg == 'success' ? '' : 'error ' ) . "mw-undo-{$undoMsg}"; - $this->editFormPageTop .= $out->parse( "
" . - $this->context->msg( 'undo-' . $undoMsg )->plain() . '
', true, /* interface */true ); + $this->editFormPageTop .= Html::rawElement( + 'div', [ 'class' => $class ], + $out->parseAsInterface( + $this->context->msg( 'undo-' . $undoMsg )->plain() + ) + ); } if ( $content === false ) { @@ -3868,9 +3872,10 @@ ERROR; // Do not put big scary notice, if previewing the empty // string, which happens when you initially edit // a category page, due to automatic preview-on-open. - $parsedNote = $out->parse( "
" . - $this->context->msg( 'session_fail_preview_html' )->text() . "
", - true, /* interface */true ); + $parsedNote = Html::rawElement( 'div', [ 'class' => 'previewnote' ], + $out->parseAsInterface( + $this->context->msg( 'session_fail_preview_html' )->plain() + ) ); } $this->incrementEditFailureStats( 'session_loss' ); return $parsedNote; @@ -3984,15 +3989,22 @@ ERROR; } if ( $this->isConflict ) { - $conflict = '

' - . $this->context->msg( 'previewconflict' )->escaped() . "

\n"; + $conflict = Html::rawElement( + 'h2', [ 'id' => 'mw-previewconflict' ], + $this->context->msg( 'previewconflict' )->escaped() + ); } else { $conflict = '
'; } - $previewhead = "
\n" . - '

' . $this->context->msg( 'preview' )->escaped() . "

" . - $out->parse( $note, true, /* interface */true ) . $conflict . "
\n"; + $previewhead = Html::rawElement( + 'div', [ 'class' => 'previewnote' ], + Html::rawElement( + 'h2', [ 'id' => 'mw-previewheader' ], + $this->context->msg( 'preview' )->escaped() + ) . + $out->parseAsInterface( $note ) . $conflict + ); $pageViewLang = $this->mTitle->getPageViewLanguage(); $attribs = [ 'lang' => $pageViewLang->getHtmlCode(), 'dir' => $pageViewLang->getDir(), diff --git a/includes/actions/McrUndoAction.php b/includes/actions/McrUndoAction.php index 12fd4f4344..b60820c0c3 100644 --- a/includes/actions/McrUndoAction.php +++ b/includes/actions/McrUndoAction.php @@ -283,9 +283,15 @@ class McrUndoAction extends FormAction { $previewHTML = ''; } - $previewhead = "
\n" . - '

' . $this->context->msg( 'preview' )->escaped() . "

" . - $out->parse( $note, true, /* interface */true ) . "
\n"; + $previewhead = Html::rawElement( + 'div', [ 'class' => 'previewnote' ], + Html::element( + 'h2', [ 'id' => 'mw-previewheader' ], + $this->context->msg( 'preview' )->text() + ) . + $out->parseAsInterface( $note ) . + "
" + ); $pageViewLang = $this->getTitle()->getPageViewLanguage(); $attribs = [ 'lang' => $pageViewLang->getHtmlCode(), 'dir' => $pageViewLang->getDir(), diff --git a/includes/skins/QuickTemplate.php b/includes/skins/QuickTemplate.php index e4a247640e..06d0f7b5e8 100644 --- a/includes/skins/QuickTemplate.php +++ b/includes/skins/QuickTemplate.php @@ -146,8 +146,8 @@ abstract class QuickTemplate { function msgWiki( $msgKey ) { global $wgOut; - $text = wfMessage( $msgKey )->text(); - echo $wgOut->parse( $text ); + $text = wfMessage( $msgKey )->plain(); + echo $wgOut->parseAsInterface( $text ); } /** diff --git a/includes/skins/Skin.php b/includes/skins/Skin.php index 91d2a7eeae..1b91c89974 100644 --- a/includes/skins/Skin.php +++ b/includes/skins/Skin.php @@ -1554,7 +1554,7 @@ abstract class Skin extends ContextSource { // TTL in seconds 600, function () use ( $notice ) { - return $this->getOutput()->parse( $notice ); + return $this->getOutput()->parseAsInterface( $notice ); } ); diff --git a/includes/specials/SpecialTags.php b/includes/specials/SpecialTags.php index ca8ce89804..fd2d46a24b 100644 --- a/includes/specials/SpecialTags.php +++ b/includes/specials/SpecialTags.php @@ -307,7 +307,7 @@ class SpecialTags extends SpecialPage { $headerText = $this->msg( 'tags-create-warnings-above', $tag, count( $status->getWarningsArray() ) )->parseAsBlock() . - $out->parse( $status->getWikiText() ) . + $out->parseAsInterface( $status->getWikiText() ) . $this->msg( 'tags-create-warnings-below' )->parseAsBlock(); $subform = HTMLForm::factory( 'ooui', $fields, $this->getContext() ); diff --git a/includes/specials/SpecialUpload.php b/includes/specials/SpecialUpload.php index 4dbfc5482d..dbb1481c49 100644 --- a/includes/specials/SpecialUpload.php +++ b/includes/specials/SpecialUpload.php @@ -489,7 +489,7 @@ class SpecialUpload extends SpecialPage { // Fetch the file if required $status = $this->mUpload->fetchFile(); if ( !$status->isOK() ) { - $this->showUploadError( $this->getOutput()->parse( $status->getWikiText() ) ); + $this->showUploadError( $this->getOutput()->parseAsInterface( $status->getWikiText() ) ); return; } @@ -559,7 +559,9 @@ class SpecialUpload extends SpecialPage { $changeTagsStatus = ChangeTags::canAddTagsAccompanyingChange( $changeTags, $this->getUser() ); if ( !$changeTagsStatus->isOK() ) { - $this->showUploadError( $this->getOutput()->parse( $changeTagsStatus->getWikiText() ) ); + $this->showUploadError( $this->getOutput()->parseAsInterface( + $changeTagsStatus->getWikiText() + ) ); return; } @@ -574,7 +576,9 @@ class SpecialUpload extends SpecialPage { ); if ( !$status->isGood() ) { - $this->showRecoverableUploadError( $this->getOutput()->parse( $status->getWikiText() ) ); + $this->showRecoverableUploadError( + $this->getOutput()->parseAsInterface( $status->getWikiText() ) + ); return; }