X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialDeletedContributions.php;h=8817ba3de47b5b7e51755ff14f8b2f12a5decfc6;hb=37e011b5554dd9b2966ccfdbef9a9bc8309a233f;hp=d405be74162b8f98dd5d26d9efce177cd630c1c4;hpb=f2b01310d90060ba2ccba3e6d36b67e942bff978;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index d405be7416..8817ba3de4 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -21,6 +21,9 @@ * @ingroup SpecialPage */ +use MediaWiki\Block\DatabaseBlock; +use MediaWiki\MediaWikiServices; + /** * Implements Special:DeletedContributions to display archived revisions * @ingroup SpecialPage @@ -44,8 +47,6 @@ class DeletedContributionsPage extends SpecialPage { $this->outputHeader(); $this->checkPermissions(); - $user = $this->getUser(); - $out = $this->getOutput(); $out->setPageTitle( $this->msg( 'deletedcontributions-title' ) ); @@ -159,10 +160,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