From cca9cf2c8683fe14c3698d8da52bfd45a2febb8d Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sun, 16 Jul 2017 11:31:21 +0100 Subject: [PATCH] Workaround for plugin versions being read as strings from plugin.yml Config is a real pain in the ass to work with... need to split it up so this can be handled properly --- src/pocketmine/plugin/PluginDescription.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/plugin/PluginDescription.php b/src/pocketmine/plugin/PluginDescription.php index a53b5b27d..dc7be00e8 100644 --- a/src/pocketmine/plugin/PluginDescription.php +++ b/src/pocketmine/plugin/PluginDescription.php @@ -69,9 +69,9 @@ class PluginDescription{ throw new PluginException("Invalid PluginDescription name"); } $this->name = str_replace(" ", "_", $this->name); - $this->version = $plugin["version"]; + $this->version = (string) $plugin["version"]; $this->main = $plugin["main"]; - $this->api = !is_array($plugin["api"]) ? [$plugin["api"]] : $plugin["api"]; + $this->api = array_map(function($v){ return (string) $v; }, !is_array($plugin["api"]) ? [$plugin["api"]] : $plugin["api"]); if(stripos($this->main, "pocketmine\\") === 0){ throw new PluginException("Invalid PluginDescription main, cannot start within the PocketMine namespace"); }