mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-24 20:04:28 +00:00
VersionString: use appropriate regex for number matching
This commit is contained in:
parent
7d74ebbebc
commit
ec5af0398e
@ -55,7 +55,7 @@ class VersionString{
|
|||||||
$this->development = $isDevBuild;
|
$this->development = $isDevBuild;
|
||||||
$this->build = $buildNumber;
|
$this->build = $buildNumber;
|
||||||
|
|
||||||
preg_match('/([0-9]+)\.([0-9]+)\.([0-9]+)(?:-(.*))?$/', $this->baseVersion, $matches);
|
preg_match('/(\d+)\.(\d+)\.(\d+)(?:-(.*))?$/', $this->baseVersion, $matches);
|
||||||
if(count($matches) < 4){
|
if(count($matches) < 4){
|
||||||
throw new \InvalidArgumentException("Invalid base version \"$baseVersion\", should contain at least 3 version digits");
|
throw new \InvalidArgumentException("Invalid base version \"$baseVersion\", should contain at least 3 version digits");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user