static function splitTrail( $trail ) {
$regex = MediaWikiServices::getInstance()->getContentLanguage()->linkTrail();
$inside = '';
- if ( $trail !== '' ) {
- $m = [];
- if ( preg_match( $regex, $trail, $m ) ) {
- $inside = $m[1];
- $trail = $m[2];
- }
+ if ( $trail !== '' && preg_match( $regex, $trail, $m ) ) {
+ list( , $inside, $trail ) = $m;
}
return [ $inside, $trail ];
}
$inner = $context->msg( 'brackets' )->rawParams( $inner )->escaped();
}
- if ( $context->getUser()->getBoolOption( 'showrollbackconfirmation' ) ) {
+ /**
+ * FIXME
+ * Remove all references to DisableRollbackConfirmationFeature
+ * after release of rollback feature. See T199534
+ */
+ if ( !MediaWikiServices::getInstance()
+ ->getMainConfig()->get( 'DisableRollbackConfirmationFeature' ) &&
+ $context->getUser()->getBoolOption( 'showrollbackconfirmation' )
+ ) {
+ $stats = MediaWikiServices::getInstance()->getStatsdDataFactory();
+ $stats->increment( 'rollbackconfirmation.event.load' );
$context->getOutput()->addModules( 'mediawiki.page.rollback.confirmation' );
}
}
$title = $rev->getTitle();
+
$query = [
'action' => 'rollback',
'from' => $rev->getUserText(),
'token' => $context->getUser()->getEditToken( 'rollback' ),
];
+
$attrs = [
'data-mw' => 'interface',
- 'title' => $context->msg( 'tooltip-rollback' )->text(),
- 'data-rollback-count' => (int)$editCount
+ 'title' => $context->msg( 'tooltip-rollback' )->text()
];
+
$options = [ 'known', 'noclasses' ];
if ( $context->getRequest()->getBool( 'bot' ) ) {
+ //T17999
+ $query['hidediff'] = '1';
$query['bot'] = '1';
- $query['hidediff'] = '1'; // T17999
}
$disableRollbackEditCount = false;