General: Use functions that are more random to reduce likelihood of UUID collisions.
`mt_rand` produces not fully random numbers which makes it so `wp_generate_uuid4` was more likely to produce a uuid which collides with another uuid it produced. This attempts to make those collisions much less likely. Since `wp_rand` is a pluggable function, it's not loaded until after plugins have been loaded. In order to make it so this function can still be used early, it falls back first to `random_int`, which will throw an exception if it can't find an appropriate source of randomness, and then to the existing, but flawed, `mt_rand`. Props johnbillion, peterwilsoncc, westonruter, mukesh27, siliconforks, alexodiy, juanmaguitar, audrasjb, joppuyo, jorbin. Fixes #59239. git-svn-id: https://develop.svn.wordpress.org/trunk@62054 602fd350-edb4-49c9-b593-d223f7449a82
A
Aaron Jorbin committed
aaf38cabec6a9beaf2bb129d3203b696d4204214
Parent: d0dfc76