->params( $this->getLanguage()->listToText( $missing ) )
->numParams( count( $missing ) )
->parseAsBlock();
- $out->addHtml( $msg );
+ $out->addHTML( $msg );
}
public function showDiffPage( $diffOnly = false ) {
<h2 class='diff-currentversion-title'>{$revHeader}</h2>\n" );
# Page content may be handled by a hooked call instead...
# @codingStandardsIgnoreStart Ignoring long lines.
- if ( Hooks::run( 'ArticleContentOnDiff', array( $this, $out ) ) ) {
+ if ( Hooks::run( 'ArticleContentOnDiff', [ $this, $out ] ) ) {
$this->loadNewText();
$out->setRevisionId( $this->mNewid );
$out->setRevisionTimestamp( $this->mNewRev->getTimestamp() );
// This needs to be synchronised with Article::showCssOrJsPage(), which sucks
// Give hooks a chance to customise the output
// @todo standardize this crap into one function
- if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
+ if ( ContentHandler::runLegacyHooks( 'ShowRawCssJs', [ $this->mNewContent, $this->mNewPage, $out ] ) ) {
// NOTE: deprecated hook, B/C only
// use the content object's own rendering
$cnt = $this->mNewRev->getContent();
$out->addParserOutputContent( $po );
}
}
- } elseif ( !Hooks::run( 'ArticleContentViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
+ } elseif ( !Hooks::run( 'ArticleContentViewCustom', [ $this->mNewContent, $this->mNewPage, $out ] ) ) {
// Handled by extension
- } elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom', array( $this->mNewContent, $this->mNewPage, $out ) ) ) {
+ } elseif ( !ContentHandler::runLegacyHooks( 'ArticleViewCustom', [ $this->mNewContent, $this->mNewPage, $out ] ) ) {
// NOTE: deprecated hook, B/C only
// Handled by extension
} else {
}
// Short-circuit
if ( $this->mOldRev === false || ( $this->mOldRev && $this->mNewRev
- && $this->mOldRev->getID() == $this->mNewRev->getID() )
+ && $this->mOldRev->getId() == $this->mNewRev->getId() )
) {
return '';
}
$result = $this->textDiff( $otext, $ntext );
- $time = microtime( true ) - $time;
+ $time = intval( ( microtime( true ) - $time ) * 1000 );
$this->getStats()->timing( 'diff_time', $time );
+ // Log requests slower than 99th percentile
+ if ( $time > 100 && $this->mOldPage && $this->mNewPage ) {
+ wfDebugLog( 'diff',
+ "$time ms diff: {$this->mOldid} -> {$this->mNewid} {$this->mNewPage}" );
+ }
return $result;
}
$title = $rev->getTitle();
$header = Linker::linkKnown( $title, $header, [],
- [ 'oldid' => $rev->getID() ] );
+ [ 'oldid' => $rev->getId() ] );
if ( $rev->userCan( Revision::DELETED_TEXT, $user ) ) {
$editQuery = [ 'action' => 'edit' ];
if ( !$rev->isCurrent() ) {
- $editQuery['oldid'] = $rev->getID();
+ $editQuery['oldid'] = $rev->getId();
}
$key = $title->quickUserCan( 'edit', $user ) ? 'editold' : 'viewsourceold';
return $header . $diff . "</table>";
}
- /**
- * Use specified text instead of loading from the database
- * @deprecated since 1.21, use setContent() instead.
- */
- public function setText( $oldText, $newText ) {
- ContentHandler::deprecated( __METHOD__, "1.21" );
-
- $oldContent = ContentHandler::makeContent( $oldText, $this->getTitle() );
- $newContent = ContentHandler::makeContent( $newText, $this->getTitle() );
-
- $this->setContent( $oldContent, $newContent );
- }
-
/**
* Use specified text instead of loading from the database
* @param Content $oldContent