| Index: trunk/extensions/Renameuser/SpecialRenameuser_body.php |
| — | — | @@ -141,6 +141,17 @@ |
| 142 | 142 | return; |
| 143 | 143 | } |
| 144 | 144 | |
| | 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 | + |
| 145 | 156 | // Check for the existence of lowercase oldusername in database. |
| 146 | 157 | // Until r19631 it was possible to rename a user to a name with first character as lowercase |
| 147 | 158 | if ( $wgRequest->getText( 'oldusername' ) !== $wgContLang->ucfirst( $wgRequest->getText( 'oldusername' ) ) ) { |
| Index: trunk/extensions/Renameuser/SpecialRenameuser.i18n.php |
| — | — | @@ -18,6 +18,7 @@ |
| 19 | 19 | 'renameusererrorexists' => 'The user "<nowiki>$1</nowiki>" already exists', |
| 20 | 20 | 'renameusererrorinvalid' => 'The username "<nowiki>$1</nowiki>" is invalid', |
| 21 | 21 | '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', |
| 22 | 23 | 'renameusersuccess' => 'The user "<nowiki>$1</nowiki>" has been renamed to "<nowiki>$2</nowiki>"', |
| 23 | 24 | 'renameuser-page-exists' => 'The page $1 already exists and cannot be automatically overwritten.', |
| 24 | 25 | 'renameuser-page-moved' => 'The page $1 has been moved to $2.', |