Make random_seed a transient
git-svn-id: https://develop.svn.wordpress.org/trunk@10838 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
e57d0ac693
commit
85aa38df9b
@ -1411,7 +1411,7 @@ if ( !function_exists('wp_rand') ) :
|
||||
function wp_rand( $min = 0, $max = 0 ) {
|
||||
global $rnd_value;
|
||||
|
||||
$seed = get_option('random_seed');
|
||||
$seed = get_transient('random_seed');
|
||||
|
||||
// Reset $rnd_value after 14 uses
|
||||
// 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 . $seed);
|
||||
$seed = md5($seed . $rnd_value);
|
||||
update_option('random_seed', $seed);
|
||||
set_transient('random_seed', $seed);
|
||||
}
|
||||
|
||||
// Take the first 8 digits for our value
|
||||
|
Loading…
Reference in New Issue
Block a user