Force reindexation of User::mRights. Hooks have the possibility to unset rights,...
authorBryan Tong Minh <btongminh@users.mediawiki.org>
Tue, 20 May 2008 08:06:43 +0000 (08:06 +0000)
committerBryan Tong Minh <btongminh@users.mediawiki.org>
Tue, 20 May 2008 08:06:43 +0000 (08:06 +0000)
includes/User.php

index 837d758..234752a 100644 (file)
@@ -1725,6 +1725,8 @@ class User {
                if ( is_null( $this->mRights ) ) {
                        $this->mRights = self::getGroupPermissions( $this->getEffectiveGroups() );
                        wfRunHooks( 'UserGetRights', array( $this, &$this->mRights ) );
+                       // Force reindexation of rights when a hook has unset one of them
+                       $this->mRights = array_values( $this->mRights );
                }
                return $this->mRights;
        }