Remove hardcoded parentheticals from ChangesList "comments"
[lhc/web/wiklou.git] / includes / specials / SpecialDeletedContributions.php
index 5c8b3a6..e4672f8 100644 (file)
@@ -21,6 +21,8 @@
  * @ingroup SpecialPage
  */
 
+use MediaWiki\MediaWikiServices;
+
 /**
  * Implements Special:DeletedContributions to display archived revisions
  * @ingroup SpecialPage
@@ -59,7 +61,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 +73,7 @@ class DeletedContributionsPage extends SpecialPage {
 
                $this->mOpts = $opts;
 
-               $target = $opts->getValue( 'target' );
+               $target = trim( $opts->getValue( 'target' ) );
                if ( !strlen( $target ) ) {
                        $this->getForm();
 
@@ -97,7 +101,8 @@ class DeletedContributionsPage extends SpecialPage {
                }
 
                # Show a message about replica DB lag, if applicable
-               $lag = wfGetLB()->safeGetLag( $pager->getDatabase() );
+               $lb = MediaWikiServices::getInstance()->getDBLoadBalancer();
+               $lag = $lb->safeGetLag( $pager->getDatabase() );
                if ( $lag > 0 ) {
                        $out->showLagWarning( $lag );
                }