Legoktm has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/280687

Change subject: Don't fatal on invalid usernames in Special:GlobalRenameUser
......................................................................

Don't fatal on invalid usernames in Special:GlobalRenameUser

Follows up c14306aa53ec6f49.

Change-Id: I283b05dfe767f30ced0cfb8bc606ae045957f89c
---
M includes/specials/SpecialGlobalRenameUser.php
1 file changed, 10 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/CentralAuth 
refs/changes/87/280687/1

diff --git a/includes/specials/SpecialGlobalRenameUser.php 
b/includes/specials/SpecialGlobalRenameUser.php
index ae31fe9..37787ac 100644
--- a/includes/specials/SpecialGlobalRenameUser.php
+++ b/includes/specials/SpecialGlobalRenameUser.php
@@ -97,14 +97,16 @@
                $oldName = trim( $this->getRequest()->getText( 'oldname' ) );
                if ( $oldName !== '' ) {
                        $oldUser = User::newFromName( $oldName );
-                       $caUser = CentralAuthUser::getInstance( $oldUser );
-                       if ( $caUser->getGlobalEditCount() > 
self::EDITCOUNT_THRESHOLD ) {
-                               $fields['allowhigheditcount'] = array(
-                                       'id' => 
'mw-globalrenameuser-allowhigheditcount',
-                                       'label' => $this->msg( 
'centralauth-rename-form-allowhigheditcount' )
-                                               ->numParams( 
self::EDITCOUNT_THRESHOLD )->escaped(),
-                                       'type' => 'check'
-                               );
+                       if ( $oldUser ) {
+                               $caUser = CentralAuthUser::getInstance( 
$oldUser );
+                               if ( $caUser->getGlobalEditCount() > 
self::EDITCOUNT_THRESHOLD ) {
+                                       $fields['allowhigheditcount'] = array(
+                                               'id' => 
'mw-globalrenameuser-allowhigheditcount',
+                                               'label' => $this->msg( 
'centralauth-rename-form-allowhigheditcount' )
+                                                       ->numParams( 
self::EDITCOUNT_THRESHOLD )->escaped(),
+                                               'type' => 'check'
+                                       );
+                               }
                        }
                }
 

-- 
To view, visit https://gerrit.wikimedia.org/r/280687
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I283b05dfe767f30ced0cfb8bc606ae045957f89c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/CentralAuth
Gerrit-Branch: master
Gerrit-Owner: Legoktm <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to