Merge "Type hint against LinkTarget in WatchedItemStore"
[lhc/web/wiklou.git] / includes / specials / SpecialDeletedContributions.php
index 65cf79e..40d8962 100644 (file)
@@ -21,6 +21,9 @@
  * @ingroup SpecialPage
  */
 
+use MediaWiki\Block\DatabaseBlock;
+use MediaWiki\MediaWikiServices;
+
 /**
  * Implements Special:DeletedContributions to display archived revisions
  * @ingroup SpecialPage
@@ -43,6 +46,7 @@ class DeletedContributionsPage extends SpecialPage {
                $this->setHeaders();
                $this->outputHeader();
                $this->checkPermissions();
+               $this->addHelpLink( 'Help:User contributions' );
 
                $out = $this->getOutput();
                $out->setPageTitle( $this->msg( 'deletedcontributions-title' ) );
@@ -157,10 +161,11 @@ class DeletedContributionsPage extends SpecialPage {
                        $links = $this->getLanguage()->pipeList( $tools );
 
                        // Show a note if the user is blocked and display the last block log entry.
-                       $block = Block::newFromTarget( $userObj, $userObj );
-                       if ( !is_null( $block ) && $block->getType() != Block::TYPE_AUTO ) {
-                               if ( $block->getType() == Block::TYPE_RANGE ) {
-                                       $nt = MWNamespace::getCanonicalName( NS_USER ) . ':' . $block->getTarget();
+                       $block = DatabaseBlock::newFromTarget( $userObj, $userObj );
+                       if ( !is_null( $block ) && $block->getType() != DatabaseBlock::TYPE_AUTO ) {
+                               if ( $block->getType() == DatabaseBlock::TYPE_RANGE ) {
+                                       $nt = MediaWikiServices::getInstance()->getNamespaceInfo()->
+                                               getCanonicalName( NS_USER ) . ':' . $block->getTarget();
                                }
 
                                // LogEventsList::showLogExtract() wants the first parameter by ref