mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-12 14:35:35 +00:00
Fixed UUID variant corruption in UUID->toString(), close #1286
This class may encapsulate any type of UUID, not just RFC 4122. Additionally, an RFC 4122 UUID may have this set as 8, 9, A or B.
This commit is contained in:
parent
90edb8ebe7
commit
238b3ca4c1
@ -94,9 +94,6 @@ class UUID{
|
||||
$hex = bin2hex($this->toBinary());
|
||||
|
||||
//xxxxxxxx-xxxx-Mxxx-Nxxx-xxxxxxxxxxxx 8-4-4-4-12
|
||||
if($this->version !== null){
|
||||
return substr($hex, 0, 8) . "-" . substr($hex, 8, 4) . "-" . hexdec($this->version) . substr($hex, 13, 3) . "-8" . substr($hex, 17, 3) . "-" . substr($hex, 20, 12);
|
||||
}
|
||||
return substr($hex, 0, 8) . "-" . substr($hex, 8, 4) . "-" . substr($hex, 12, 4) . "-" . substr($hex, 16, 4) . "-" . substr($hex, 20, 12);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user