From 50bcc3c8f5e2701aa00bbfa3e37ffaddc21ae6df Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Tue, 20 May 2008 08:06:43 +0000 Subject: [PATCH] Force reindexation of User::mRights. Hooks have the possibility to unset rights, leaving the array out of order. --- includes/User.php | 2 ++ 1 file changed, 2 insertions(+) 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; } -- 2.20.1