diff --git a/cake/libs/string.php b/cake/libs/string.php index a85db0065..eae2d24ac 100644 --- a/cake/libs/string.php +++ b/cake/libs/string.php @@ -136,13 +136,13 @@ class String extends Object { $pid = getmypid(); } - if (!$pid) { + if (!$pid || $pid > 65535) { $pid = mt_rand(0, 0xfff) | 0x4000; } list($timeMid, $timeLow) = explode(' ', microtime()); $uuid = sprintf("%08x-%04x-%04x-%02x%02x-%04x%08x", (int)$timeLow, (int)substr($timeMid, 2) & 0xffff, - mt_rand(0, 0xfff) | 0x4000, mt_rand(0, 0x3f) | 0x80, mt_rand(0, 0xff), substr($pid, 0, 5), $node); + mt_rand(0, 0xfff) | 0x4000, mt_rand(0, 0x3f) | 0x80, mt_rand(0, 0xff), $pid, $node); return $uuid; }