From: Bryan Tong Minh Date: Tue, 20 May 2008 08:06:43 +0000 (+0000) Subject: Force reindexation of User::mRights. Hooks have the possibility to unset rights,... X-Git-Tag: 1.31.0-rc.0~47521 X-Git-Url: http://git.cyclocoop.org/%40spipnet%40?a=commitdiff_plain;h=50bcc3c8f5e2701aa00bbfa3e37ffaddc21ae6df;p=lhc%2Fweb%2Fwiklou.git Force reindexation of User::mRights. Hooks have the possibility to unset rights, leaving the array out of order. --- diff --git a/includes/User.php b/includes/User.php index 837d7587b6..234752a414 100644 --- a/includes/User.php +++ b/includes/User.php @@ -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; }