mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-09-05 17:36:12 +00:00
Fixed PermissibleBase->clearPermissions() not unsubscribing from permissions that aren't explicitly assigned
This came to light after observing cfb6856634
in a fresh light. I noticed that this fix should not have been necessary because clearPermissions() should have dealt with it. Unfortunately, permissions can be set without being set in PermissibleBase->permissions, so this misses things.
This commit is contained in:
@ -534,6 +534,18 @@ class PluginManager{
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Permissible $permissible
|
||||
*/
|
||||
public function unsubscribeFromAllPermissions(Permissible $permissible) : void{
|
||||
foreach($this->permSubs as $permission => &$subs){
|
||||
unset($subs[spl_object_hash($permissible)]);
|
||||
if(empty($subs)){
|
||||
unset($this->permSubs[$permission]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param string $permission
|
||||
*
|
||||
|
Reference in New Issue
Block a user