Merge "Properly mark UserGetImplicitGroups hook as deprecated"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 21 Nov 2014 20:58:59 +0000 (20:58 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 21 Nov 2014 20:58:59 +0000 (20:58 +0000)
1  2 
includes/User.php

diff --combined includes/User.php
@@@ -641,11 -641,10 +641,11 @@@ class User implements IDBAccessObject 
                global $wgContLang, $wgMaxNameChars;
  
                if ( $name == ''
 -              || User::isIP( $name )
 -              || strpos( $name, '/' ) !== false
 -              || strlen( $name ) > $wgMaxNameChars
 -              || $name != $wgContLang->ucfirst( $name ) ) {
 +                      || User::isIP( $name )
 +                      || strpos( $name, '/' ) !== false
 +                      || strlen( $name ) > $wgMaxNameChars
 +                      || $name != $wgContLang->ucfirst( $name )
 +              ) {
                        wfDebugLog( 'username', __METHOD__ .
                                ": '$name' invalid due to empty, IP, slash, length, or lowercase" );
                        return false;
                global $wgImplicitGroups;
  
                $groups = $wgImplicitGroups;
-               # Deprecated, use $wgImplictGroups instead
-               wfRunHooks( 'UserGetImplicitGroups', array( &$groups ) );
+               # Deprecated, use $wgImplicitGroups instead
+               wfRunHooks( 'UserGetImplicitGroups', array( &$groups ), '1.25' );
  
                return $groups;
        }
  
                // Same thing for remove
                if ( empty( $wgRemoveGroups[$group] ) ) {
 +                      // Do nothing
                } elseif ( $wgRemoveGroups[$group] === true ) {
                        $groups['remove'] = self::getAllGroups();
                } elseif ( is_array( $wgRemoveGroups[$group] ) ) {
  
                // Now figure out what groups the user can add to him/herself
                if ( empty( $wgGroupsAddToSelf[$group] ) ) {
 +                      // Do nothing
                } elseif ( $wgGroupsAddToSelf[$group] === true ) {
                        // No idea WHY this would be used, but it's there
                        $groups['add-self'] = User::getAllGroups();
                }
  
                if ( empty( $wgGroupsRemoveFromSelf[$group] ) ) {
 +                      // Do nothing
                } elseif ( $wgGroupsRemoveFromSelf[$group] === true ) {
                        $groups['remove-self'] = User::getAllGroups();
                } elseif ( is_array( $wgGroupsRemoveFromSelf[$group] ) ) {