Make random_seed a transient
git-svn-id: http://svn.automattic.com/wordpress/trunk@10838 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
05783317a4
commit
693fd1774e
|
@ -1411,7 +1411,7 @@ if ( !function_exists('wp_rand') ) :
|
||||||
function wp_rand( $min = 0, $max = 0 ) {
|
function wp_rand( $min = 0, $max = 0 ) {
|
||||||
global $rnd_value;
|
global $rnd_value;
|
||||||
|
|
||||||
$seed = get_option('random_seed');
|
$seed = get_transient('random_seed');
|
||||||
|
|
||||||
// Reset $rnd_value after 14 uses
|
// Reset $rnd_value after 14 uses
|
||||||
// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
|
// 32(md5) + 40(sha1) + 40(sha1) / 8 = 14 random numbers from $rnd_value
|
||||||
|
@ -1420,7 +1420,7 @@ function wp_rand( $min = 0, $max = 0 ) {
|
||||||
$rnd_value .= sha1($rnd_value);
|
$rnd_value .= sha1($rnd_value);
|
||||||
$rnd_value .= sha1($rnd_value . $seed);
|
$rnd_value .= sha1($rnd_value . $seed);
|
||||||
$seed = md5($seed . $rnd_value);
|
$seed = md5($seed . $rnd_value);
|
||||||
update_option('random_seed', $seed);
|
set_transient('random_seed', $seed);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Take the first 8 digits for our value
|
// Take the first 8 digits for our value
|
||||||
|
|
Loading…
Reference in New Issue