// Messages: undo-success, undo-failure, undo-main-slot-only, undo-norev,
// undo-nochange.
$class = ( $undoMsg == 'success' ? '' : 'error ' ) . "mw-undo-{$undoMsg}";
- $this->editFormPageTop .= $out->parse( "<div class=\"{$class}\">" .
- $this->context->msg( 'undo-' . $undoMsg )->plain() . '</div>', true, /* interface */true );
+ $this->editFormPageTop .= Html::rawElement(
+ 'div', [ 'class' => $class ],
+ $out->parseAsInterface(
+ $this->context->msg( 'undo-' . $undoMsg )->plain()
+ )
+ );
}
if ( $content === false ) {
// 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( "<div class='previewnote'>" .
- $this->context->msg( 'session_fail_preview_html' )->text() . "</div>",
- 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;
}
if ( $this->isConflict ) {
- $conflict = '<h2 id="mw-previewconflict">'
- . $this->context->msg( 'previewconflict' )->escaped() . "</h2>\n";
+ $conflict = Html::rawElement(
+ 'h2', [ 'id' => 'mw-previewconflict' ],
+ $this->context->msg( 'previewconflict' )->escaped()
+ );
} else {
$conflict = '<hr />';
}
- $previewhead = "<div class='previewnote'>\n" .
- '<h2 id="mw-previewheader">' . $this->context->msg( 'preview' )->escaped() . "</h2>" .
- $out->parse( $note, true, /* interface */true ) . $conflict . "</div>\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(),
$previewHTML = '';
}
- $previewhead = "<div class='previewnote'>\n" .
- '<h2 id="mw-previewheader">' . $this->context->msg( 'preview' )->escaped() . "</h2>" .
- $out->parse( $note, true, /* interface */true ) . "<hr /></div>\n";
+ $previewhead = Html::rawElement(
+ 'div', [ 'class' => 'previewnote' ],
+ Html::element(
+ 'h2', [ 'id' => 'mw-previewheader' ],
+ $this->context->msg( 'preview' )->text()
+ ) .
+ $out->parseAsInterface( $note ) .
+ "<hr />"
+ );
$pageViewLang = $this->getTitle()->getPageViewLanguage();
$attribs = [ 'lang' => $pageViewLang->getHtmlCode(), 'dir' => $pageViewLang->getDir(),
// 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;
}
$changeTagsStatus = ChangeTags::canAddTagsAccompanyingChange(
$changeTags, $this->getUser() );
if ( !$changeTagsStatus->isOK() ) {
- $this->showUploadError( $this->getOutput()->parse( $changeTagsStatus->getWikiText() ) );
+ $this->showUploadError( $this->getOutput()->parseAsInterface(
+ $changeTagsStatus->getWikiText()
+ ) );
return;
}
);
if ( !$status->isGood() ) {
- $this->showRecoverableUploadError( $this->getOutput()->parse( $status->getWikiText() ) );
+ $this->showRecoverableUploadError(
+ $this->getOutput()->parseAsInterface( $status->getWikiText() )
+ );
return;
}