Index: trunk/extensions/ReassignEdits/ReassignEdits_body.php |
— | — | @@ -13,7 +13,7 @@ |
14 | 14 | */ |
15 | 15 | |
16 | 16 | if (!defined('MEDIAWIKI')) { |
17 | | - echo "THIS IS NOT VALID ENTRY POINT"; |
| 17 | + echo "ReassignEdits extension"; |
18 | 18 | exit(1); |
19 | 19 | } |
20 | 20 | |
— | — | @@ -146,11 +146,10 @@ |
147 | 147 | } |
148 | 148 | |
149 | 149 | // Get usernames by id |
150 | | - $olduser = User::newFromName( $oldusername->getText() ); |
151 | 150 | $newuser = User::newFromName( $newusername->getText() ); |
152 | 151 | |
153 | 152 | // It won't be an object if for instance "|" is supplied as a value |
154 | | - if ( !is_object( $olduser ) ) { |
| 153 | + if ( !is_string( $oldusername->getText() ) ) { |
155 | 154 | $wgOut->addWikiText( "<div class=\"errorbox\">" . wfMsg( 'reassignedits-error-invalid', |
156 | 155 | $oldusername->getText() ) . "</div>" ); |
157 | 156 | return; |
— | — | @@ -161,27 +160,6 @@ |
162 | 161 | return; |
163 | 162 | } |
164 | 163 | |
165 | | - // Check for the existence of lowercase oldusername in database |
166 | | - if ( $oldusername->getText() !== $wgContLang->ucfirst( $oldusername->getText() ) ) { |
167 | | - // oldusername was entered as lowercase -> check for existence in table 'user' |
168 | | - $dbr = wfGetDB( DB_SLAVE ); |
169 | | - $uid = $dbr->selectField( 'user', 'user_id', |
170 | | - array( 'user_name' => $oldusername->getText() ), |
171 | | - __METHOD__ ); |
172 | | - if ( $uid === false ) { |
173 | | - if ( !$wgCapitalLinks ) { |
174 | | - $uid = 0; // We are on a lowercase wiki but lowercase username does not exists |
175 | | - } else { |
176 | | - // We are on a standard uppercase wiki, use normal |
177 | | - $uid = $olduser->idForName(); |
178 | | - $oldusername = Title::makeTitleSafe( NS_USER, $olduser->getName() ); |
179 | | - } |
180 | | - } |
181 | | - } else { |
182 | | - // oldusername was entered as upperase -> standard procedure |
183 | | - $uid = $olduser->idForName(); |
184 | | - } |
185 | | - |
186 | 164 | // Do the heavy lifting... |
187 | 165 | $reassign = new ReassignEditsSQL( $oldusername->getText(), $newusername->getText() ); |
188 | 166 | if ( !$reassign->reassign() ) { |