Fixed exception thrown when plugins specify API version like 3.0 instead of 3.0.0

This could only be seen in a build with a non-suffixed API version, for example 3.0.0. When attempting to load plugins which specify API like 3.0 the server would raise errors.
This commit is contained in:
Dylan K. Taylor 2017-09-01 18:13:07 +01:00
parent 6e8631347d
commit 506118e28f

View File

@ -238,7 +238,7 @@ class PluginManager{
continue;
}
$pluginNumbers = array_map("intval", explode(".", $pluginApi[0]));
$pluginNumbers = array_map("intval", array_pad(explode(".", $pluginApi[0]), 3, "0")); //plugins might specify API like "3.0" or "3"
$serverNumbers = array_map("intval", explode(".", $serverApi[0]));
if($pluginNumbers[0] !== $serverNumbers[0]){ //Completely different API version