Microchip08 has uploaded a new change for review.
https://gerrit.wikimedia.org/r/213498
Change subject: allow the new username to be populated by subpage
......................................................................
allow the new username to be populated by subpage
Previously, [[Special:RenameUser/Foo]] prefilled the form with "Foo"
as the old username. This commit adds similar functionality for the
new username, so that [[Special:RenameUser/Foo/Bar]] will prefill
the form so that "Foo" is renamed to "Bar".
Change-Id: I5846e8548d8a10f3363ef45e00e9a791dd84063c
---
M specials/SpecialRenameuser.php
1 file changed, 4 insertions(+), 2 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/Renameuser
refs/changes/98/213498/1
diff --git a/specials/SpecialRenameuser.php b/specials/SpecialRenameuser.php
index c8b2a53..8fb7467 100644
--- a/specials/SpecialRenameuser.php
+++ b/specials/SpecialRenameuser.php
@@ -40,10 +40,12 @@
$request = $this->getRequest();
$showBlockLog = $request->getBool( 'submit-showBlockLog' );
- $oldnamePar = trim( str_replace( '_', ' ', $request->getText(
'oldusername', $par ) ) );
+ $usernames = explode( '/', $par, 2 ); // this works as "/" is
not valid in usernames
+ $oldnamePar = trim( str_replace( '_', ' ', $request->getText(
'oldusername', $usernames[0] ) ) );
$oldusername = Title::makeTitle( NS_USER, $oldnamePar );
+ $newnamePar = trim( str_replace( '_', ' ', $request->getText(
'newusername', $usernames[1] ) ) );
// Force uppercase of newusername, otherwise wikis with
wgCapitalLinks=false can create lc usernames
- $newusername = Title::makeTitleSafe( NS_USER,
$wgContLang->ucfirst( $request->getText( 'newusername' ) ) );
+ $newusername = Title::makeTitleSafe( NS_USER,
$wgContLang->ucfirst( $request->getText( 'newusername', $usernames[1] ) ) );
$oun = is_object( $oldusername ) ? $oldusername->getText() : '';
$nun = is_object( $newusername ) ? $newusername->getText() : '';
$token = $user->getEditToken();
--
To view, visit https://gerrit.wikimedia.org/r/213498
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I5846e8548d8a10f3363ef45e00e9a791dd84063c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Renameuser
Gerrit-Branch: master
Gerrit-Owner: Microchip08 <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits