Replace underscores with spaces in DeletedContribs form
authorDaimona Eaytoy <daimona.wiki@gmail.com>
Tue, 8 May 2018 09:44:06 +0000 (11:44 +0200)
committerDaimona Eaytoy <daimona.wiki@gmail.com>
Mon, 27 Aug 2018 13:10:46 +0000 (13:10 +0000)
If you go to Special:Contributions/User_Foo and click on the link to
Special:DeletedContributions/User_Foo, the form field for selecting the
user is populated with the value "User_Foo", which isn't pretty to see.
Instead, let's replace underscores with spaces to directly show "User
Foo".

Change-Id: I2b144c9dbe41e2dd01bbb530dc5b43547fc4230f

includes/specials/SpecialDeletedContributions.php

index 975d64e..3f87712 100644 (file)
@@ -61,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' );