*/
use MediaWiki\MediaWikiServices;
+use Wikimedia\Rdbms\ResultWrapper;
+use Wikimedia\Rdbms\FakeResultWrapper;
/**
* This class handles printing the history page for an article. In order to
$out->setStatusCode( 404 );
}
$out->addWikiMsg( 'nohistory' );
+
+ $dbr = wfGetDB( DB_REPLICA );
+
# show deletion/move log if there is an entry
LogEventsList::showLogExtract(
$out,
$this->getTitle(),
'',
[ 'lim' => 10,
- 'conds' => [ "log_action != 'revision'" ],
+ 'conds' => [ 'log_action != ' . $dbr->addQuotes( 'revision' ) ],
'showIfEmpty' => false,
'msgKey' => [ 'moveddeleted-notice' ]
]
$s .= ' <span class="mw-changeslist-separator">. .</span> ' . $s2;
}
- Hooks::run( 'PageHistoryLineEnding', [ $this, &$row, &$s, &$classes ] );
+ $attribs = [ 'data-mw-revid' => $rev->getId() ];
+
+ Hooks::run( 'PageHistoryLineEnding', [ $this, &$row, &$s, &$classes, &$attribs ] );
+ $attribs = wfArrayFilterByKey( $attribs, [ Sanitizer::class, 'isReservedDataAttribute' ] );
- $attribs = [];
if ( $classes ) {
$attribs['class'] = implode( ' ', $classes );
}