Force reindexation of User::mRights. Hooks have the possibility to unset rights, leaving the array out of order.

This commit is contained in:
Bryan Tong Minh 2008-05-20 08:06:43 +00:00
parent 4a790d0ae6
commit 50bcc3c8f5

View 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;
}