mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-05 11:27:07 +00:00
PluginManager: check graylist before doing any loadability checks
fixes #5087
This commit is contained in:
parent
c87a3b054c
commit
4b662d65b3
@ -270,6 +270,17 @@ class PluginManager{
|
||||
|
||||
$name = $description->getName();
|
||||
|
||||
if($this->graylist !== null && !$this->graylist->isAllowed($name)){
|
||||
$this->server->getLogger()->notice($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_loadError(
|
||||
$name,
|
||||
$this->graylist->isWhitelist() ? KnownTranslationFactory::pocketmine_plugin_disallowedByWhitelist() : KnownTranslationFactory::pocketmine_plugin_disallowedByBlacklist()
|
||||
)));
|
||||
//this does NOT increment loadErrorCount, because using the graylist to prevent a plugin from
|
||||
//loading is not considered accidental; this is the same as if the plugin were manually removed
|
||||
//this means that the server will continue to boot even if some plugins were blocked by graylist
|
||||
continue;
|
||||
}
|
||||
|
||||
if(($loadabilityError = $loadabilityChecker->check($description)) !== null){
|
||||
$this->server->getLogger()->critical($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_loadError($name, $loadabilityError)));
|
||||
$loadErrorCount++;
|
||||
@ -286,17 +297,6 @@ class PluginManager{
|
||||
$this->server->getLogger()->warning($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_spacesDiscouraged($name)));
|
||||
}
|
||||
|
||||
if($this->graylist !== null && !$this->graylist->isAllowed($name)){
|
||||
$this->server->getLogger()->notice($this->server->getLanguage()->translate(KnownTranslationFactory::pocketmine_plugin_loadError(
|
||||
$name,
|
||||
$this->graylist->isWhitelist() ? KnownTranslationFactory::pocketmine_plugin_disallowedByWhitelist() : KnownTranslationFactory::pocketmine_plugin_disallowedByBlacklist()
|
||||
)));
|
||||
//this does NOT increment loadErrorCount, because using the graylist to prevent a plugin from
|
||||
//loading is not considered accidental; this is the same as if the plugin were manually removed
|
||||
//this means that the server will continue to boot even if some plugins were blocked by graylist
|
||||
continue;
|
||||
}
|
||||
|
||||
$triage->plugins[$name] = new PluginLoadTriageEntry($file, $loader, $description);
|
||||
|
||||
$triage->softDependencies[$name] = array_merge($triage->softDependencies[$name] ?? [], $description->getSoftDepend());
|
||||
|
Loading…
x
Reference in New Issue
Block a user