X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fspecials%2FSpecialDeletedContributions.php;h=3f8771265d165d0adc6f4531295f8323c08d6075;hb=54a8b9a14f42b063a143a981067ba564860ec556;hp=5c8b3a620604272a0b08fddb4e7df154b0c1d49e;hpb=2dd58ade75d15a5895c0c010e17b6f729a0f72fe;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/specials/SpecialDeletedContributions.php b/includes/specials/SpecialDeletedContributions.php index 5c8b3a6206..65cf79ef56 100644 --- a/includes/specials/SpecialDeletedContributions.php +++ b/includes/specials/SpecialDeletedContributions.php @@ -44,8 +44,6 @@ class DeletedContributionsPage extends SpecialPage { $this->outputHeader(); $this->checkPermissions(); - $user = $this->getUser(); - $out = $this->getOutput(); $out->setPageTitle( $this->msg( 'deletedcontributions-title' ) ); @@ -59,7 +57,9 @@ class DeletedContributionsPage extends SpecialPage { $opts->validateIntBounds( 'limit', 0, $this->getConfig()->get( 'QueryPageDefaultLimit' ) ); if ( $par !== null ) { - $opts->setValue( 'target', $par ); + // Beautify the username + $par = User::getCanonicalName( $par, false ); + $opts->setValue( 'target', (string)$par ); } $ns = $opts->getValue( 'namespace' ); @@ -69,7 +69,7 @@ class DeletedContributionsPage extends SpecialPage { $this->mOpts = $opts; - $target = $opts->getValue( 'target' ); + $target = trim( $opts->getValue( 'target' ) ); if ( !strlen( $target ) ) { $this->getForm(); @@ -97,7 +97,7 @@ class DeletedContributionsPage extends SpecialPage { } # Show a message about replica DB lag, if applicable - $lag = wfGetLB()->safeGetLag( $pager->getDatabase() ); + $lag = $pager->getDatabase()->getSessionLagStatus()['lag']; if ( $lag > 0 ) { $out->showLagWarning( $lag ); } @@ -141,15 +141,18 @@ class DeletedContributionsPage extends SpecialPage { if ( $talk ) { $tools = SpecialContributions::getUserLinks( $this, $userObj ); - # Link to contributions - $insert['contribs'] = $linkRenderer->makeKnownLink( + $contributionsLink = $linkRenderer->makeKnownLink( SpecialPage::getTitleFor( 'Contributions', $nt->getDBkey() ), $this->msg( 'sp-deletedcontributions-contribs' )->text() ); - - // Swap out the deletedcontribs link for our contribs one - $tools = wfArrayInsertAfter( $tools, $insert, 'deletedcontribs' ); - unset( $tools['deletedcontribs'] ); + if ( isset( $tools['deletedcontribs'] ) ) { + // Swap out the deletedcontribs link for our contribs one + $tools = wfArrayInsertAfter( + $tools, [ 'contribs' => $contributionsLink ], 'deletedcontribs' ); + unset( $tools['deletedcontribs'] ); + } else { + $tools['contribs'] = $contributionsLink; + } $links = $this->getLanguage()->pipeList( $tools );