mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 20:14:31 +00:00
PluginManager: account for possible invalid format of API version
we're seeing a lot of crashes because of this.
This commit is contained in:
@@ -63,6 +63,10 @@ class VersionString{
|
||||
$this->suffix = $matches[4] ?? "";
|
||||
}
|
||||
|
||||
public static function isValidBaseVersion(string $baseVersion) : bool{
|
||||
return preg_match('/^\d+\.\d+\.\d+(?:-(.*))?$/', $baseVersion, $matches) === 1;
|
||||
}
|
||||
|
||||
public function getNumber() : int{
|
||||
return (($this->major << 9) | ($this->minor << 5) | $this->patch);
|
||||
}
|
||||
|
Reference in New Issue
Block a user