Gently discourage building HTML by raw string concatenation.
Fixes for Special{Contributions/Recentchanges*/Undelete/Upload}.
Change-Id: I4a128e902dcce93372b2f188a1f37223c58ebe9a
$explain = $this->msg( 'sp-contributions-explain' );
if ( !$explain->isBlank() ) {
- $form .= "<p id='mw-sp-contributions-explain'>{$explain->parse()}</p>";
+ $form .= Html::rawElement(
+ 'p', [ 'id' => 'mw-sp-contributions-explain' ], $explain->parse()
+ );
}
$form .= Xml::closeElement( 'form' );
$note = '';
$msg = $this->msg( 'rclegend' );
if ( !$msg->isDisabled() ) {
- $note .= '<div class="mw-rclegend">' . $msg->parse() . "</div>\n";
+ $note .= Html::rawElement(
+ 'div',
+ [ 'class' => 'mw-rclegend' ],
+ $msg->parse()
+ );
}
$lang = $this->getLanguage();
$datenow = $lang->userDate( $timestamp, $user );
$pipedLinks = '<span class="rcshowhide">' . $lang->pipeList( $links ) . '</span>';
- $rclinks = '<span class="rclinks">' . $this->msg( 'rclinks' )->rawParams( $cl, $dl, '' )
- ->parse() . '</span>';
+ $rclinks = Html::rawElement(
+ 'span',
+ [ 'class' => 'rclinks' ],
+ $this->msg( 'rclinks' )->rawParams( $cl, $dl, '' )->parse()
+ );
- $rclistfrom = '<span class="rclistfrom">' . $this->makeOptionsLink(
- $this->msg( 'rclistfrom' )->rawParams( $now, $timenow, $datenow )->parse(),
- [ 'from' => $timestamp ],
- $nondefaults
- ) . '</span>';
+ $rclistfrom = Html::rawElement(
+ 'span',
+ [ 'class' => 'rclistfrom' ],
+ $this->makeOptionsLink(
+ $this->msg( 'rclistfrom' )->rawParams( $now, $timenow, $datenow )->parse(),
+ [ 'from' => $timestamp ],
+ $nondefaults
+ )
+ );
return "{$note}$rclinks<br />$pipedLinks<br />$rclistfrom";
}
$targetTitle = $this->getTargetTitle();
if ( $targetTitle === false ) {
$this->getOutput()->addHTML(
- '<div class="mw-changeslist-empty mw-changeslist-notargetpage">' .
- $this->msg( 'recentchanges-notargetpage' )->parse() .
- '</div>'
+ Html::rawElement(
+ 'div',
+ [ 'class' => 'mw-changeslist-empty mw-changeslist-notargetpage' ],
+ $this->msg( 'recentchanges-notargetpage' )->parse()
+ )
);
} elseif ( !$targetTitle || $targetTitle->isExternal() ) {
$this->getOutput()->addHTML(
- '<div class="mw-changeslist-empty mw-changeslist-invalidtargetpage">' .
- $this->msg( 'allpagesbadtitle' )->parse() .
- '</div>'
+ Html::rawElement(
+ 'div',
+ [ 'class' => 'mw-changeslist-empty mw-changeslist-invalidtargetpage' ],
+ $this->msg( 'allpagesbadtitle' )->parse()
+ )
);
} else {
parent::outputNoResults();
);
}
$revs = $this->msg( 'undeleterevisions' )->numParams( $row->count )->parse();
- $out->addHTML( "<li class='undeleteResult'>{$item} ({$revs})</li>\n" );
+ $out->addHTML(
+ Html::rawElement(
+ 'li',
+ [ 'class' => 'undeleteResult' ],
+ "{$item} ({$revs})"
+ )
+ );
}
$result->free();
$out->addHTML( "</ul>\n" );
);
$link = $this->msg( $user->isAllowed( 'delete' ) ? 'thisisdeleted' : 'viewdeleted' )
->rawParams( $restorelink )->parseAsBlock();
- $this->getOutput()->addHTML( "<div id=\"contentSub2\">{$link}</div>" );
+ $this->getOutput()->addHTML(
+ Html::rawElement(
+ 'div',
+ [ 'id' => 'contentSub2' ],
+ $link
+ )
+ );
}
}
}