mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 12:04:46 +00:00
Merge commit '8726604899d1a371567141e0831ed570d3233356'
This commit is contained in:
@@ -24,6 +24,7 @@ declare(strict_types=1);
|
||||
namespace pocketmine\permission;
|
||||
|
||||
use function array_shift;
|
||||
use function count;
|
||||
use function explode;
|
||||
use function implode;
|
||||
use function strlen;
|
||||
@@ -173,19 +174,19 @@ class BanEntry{
|
||||
|
||||
$parts = explode("|", trim($str));
|
||||
$entry = new BanEntry(trim(array_shift($parts)));
|
||||
if(!empty($parts)){
|
||||
if(count($parts) > 0){
|
||||
$entry->setCreated(self::parseDate(array_shift($parts)));
|
||||
}
|
||||
if(!empty($parts)){
|
||||
if(count($parts) > 0){
|
||||
$entry->setSource(trim(array_shift($parts)));
|
||||
}
|
||||
if(!empty($parts)){
|
||||
if(count($parts) > 0){
|
||||
$expire = trim(array_shift($parts));
|
||||
if($expire !== "" and strtolower($expire) !== "forever"){
|
||||
$entry->setExpires(self::parseDate($expire));
|
||||
}
|
||||
}
|
||||
if(!empty($parts)){
|
||||
if(count($parts) > 0){
|
||||
$entry->setReason(trim(array_shift($parts)));
|
||||
}
|
||||
|
||||
|
@@ -168,7 +168,7 @@ class PermissionManager{
|
||||
public function unsubscribeFromAllPermissions(Permissible $permissible) : void{
|
||||
foreach($this->permSubs as $permission => &$subs){
|
||||
unset($subs[spl_object_id($permissible)]);
|
||||
if(empty($subs)){
|
||||
if(count($subs) === 0){
|
||||
unset($this->permSubs[$permission]);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user