dépôts
/
lhc
/
web
/
wiklou.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
b41a2f8
)
User::addGroup could cause duplicate groups
author
Niklas Laxström
<niklas.laxstrom@gmail.com>
Wed, 3 Apr 2013 12:17:32 +0000
(12:17 +0000)
committer
Gerrit Code Review
<gerrit@wikimedia.org>
Tue, 23 Apr 2013 11:52:43 +0000
(11:52 +0000)
Use array_unique to avoid this case.
Bug: 46844
Change-Id: I14eb6e5a5333d887d71d545e42570493437dd320
includes/User.php
patch
|
blob
|
history
diff --git
a/includes/User.php
b/includes/User.php
index
cb5ad7a
..
dd6407d
100644
(file)
--- a/
includes/User.php
+++ b/
includes/User.php
@@
-2668,6
+2668,9
@@
class User {
}
$this->loadGroups();
$this->mGroups[] = $group;
+ // In case loadGroups was not called before, we now have the right twice.
+ // Get rid of the duplicate.
+ $this->mGroups = array_unique( $this->mGroups );
$this->mRights = User::getGroupPermissions( $this->getEffectiveGroups( true ) );
$this->invalidateCache();