Make use of the list() feature where it makes sense
[lhc/web/wiklou.git] / includes / Linker.php
index 711b9dc..decc13c 100644 (file)
@@ -1710,12 +1710,8 @@ class Linker {
        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 ];
        }
@@ -1768,7 +1764,17 @@ class Linker {
                        $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' );
                }
 
@@ -1874,8 +1880,7 @@ class Linker {
 
                $attrs = [
                        'data-mw' => 'interface',
-                       'title' => $context->msg( 'tooltip-rollback' )->text(),
-                       'data-rollback-count' => (int)$editCount
+                       'title' => $context->msg( 'tooltip-rollback' )->text()
                ];
 
                $options = [ 'known', 'noclasses' ];