MediaWiki r29674 - Code Review

Jump to: navigation, search
Repository:MediaWiki
Revision:r29673‎ | r29674 (on ViewVC)‎ | r29675 >
Date:00:02, 13 January 2008
Author:simetrical
Status:old
Tags:
Comment:
Usernames that are invalid for creation should be invalid rename targets too.
Modified paths:

Diff [purge]

Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php
@@ -141,6 +141,17 @@
142142 return;
143143 }
144144
 145+ // Usernames that are invalid for creation should not be allowed as re-
 146+ // name targets either.
 147+ if( !User::isCreatableName( $newuser->getName() ) ) {
 148+ $wgOut->addWikiText(
 149+ "<div class=\"errorbox\">"
 150+ . wfMsg( 'renameuser-error-uncreatable', $newusername->getText() )
 151+ . "</div>"
 152+ );
 153+ return;
 154+ }
 155+
145156 // Check for the existence of lowercase oldusername in database.
146157 // Until r19631 it was possible to rename a user to a name with first character as lowercase
147158 if ( $wgRequest->getText( 'oldusername' ) !== $wgContLang->ucfirst( $wgRequest->getText( 'oldusername' ) ) ) {
Index: trunk/extensions/Renameuser/SpecialRenameuser.i18n.php
@@ -18,6 +18,7 @@
1919 'renameusererrorexists' => 'The user "<nowiki>$1</nowiki>" already exists',
2020 'renameusererrorinvalid' => 'The username "<nowiki>$1</nowiki>" is invalid',
2121 'renameusererrortoomany' => 'The user "<nowiki>$1</nowiki>" has $2 contributions, renaming a user with more than $3 contributions could adversely affect site performance',
 22+ 'renameuser-error-uncreatable' => 'The username "<nowiki>$1</nowiki>" is not valid for creation',
2223 'renameusersuccess' => 'The user "<nowiki>$1</nowiki>" has been renamed to "<nowiki>$2</nowiki>"',
2324 'renameuser-page-exists' => 'The page $1 already exists and cannot be automatically overwritten.',
2425 'renameuser-page-moved' => 'The page $1 has been moved to $2.',

Status & tagging log

  • 15:23, 12 September 2011 Meno25 (Talk | contribs) changed the status of r29674 [removed: ok added: old]
Personal tools
Namespaces

Variants
Views
Actions
Navigation
Support
Download
Development
Communication
Toolbox