mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-12 12:55:21 +00:00
PermissionParser: bail on encountering permissions whose names are not strings
This commit is contained in:
parent
197b1a8566
commit
794bb0a71d
@ -25,6 +25,7 @@ namespace pocketmine\permission;
|
|||||||
|
|
||||||
use function is_array;
|
use function is_array;
|
||||||
use function is_bool;
|
use function is_bool;
|
||||||
|
use function is_string;
|
||||||
use function strtolower;
|
use function strtolower;
|
||||||
|
|
||||||
class PermissionParser{
|
class PermissionParser{
|
||||||
@ -108,6 +109,9 @@ class PermissionParser{
|
|||||||
if(isset($data["children"])){
|
if(isset($data["children"])){
|
||||||
if(is_array($data["children"])){
|
if(is_array($data["children"])){
|
||||||
foreach($data["children"] as $k => $v){
|
foreach($data["children"] as $k => $v){
|
||||||
|
if(!is_string($k)){
|
||||||
|
throw new \InvalidArgumentException("Permission name should be string");
|
||||||
|
}
|
||||||
if(is_array($v)){
|
if(is_array($v)){
|
||||||
self::loadPermission($k, $v, $default, $output);
|
self::loadPermission($k, $v, $default, $output);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user