Multisite: Use `wp_rand()` in signup key creation.

Merges [39795] to the 4.3 branch.

Built from https://develop.svn.wordpress.org/branches/4.3@39800


git-svn-id: http://core.svn.wordpress.org/branches/4.3@39738 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
Jeremy Felt 2017-01-11 05:34:27 +00:00
parent ed440a7cf4
commit a06e0059b1
1 changed files with 2 additions and 2 deletions

View File

@ -731,7 +731,7 @@ function wpmu_validate_blog_signup( $blogname, $blog_title, $user = '' ) {
function wpmu_signup_blog( $domain, $path, $title, $user, $user_email, $meta = array() ) {
global $wpdb;
$key = substr( md5( time() . rand() . $domain ), 0, 16 );
$key = substr( md5( time() . wp_rand() . $domain ), 0, 16 );
$meta = serialize($meta);
$wpdb->insert( $wpdb->signups, array(
@ -768,7 +768,7 @@ function wpmu_signup_user( $user, $user_email, $meta = array() ) {
// Format data
$user = preg_replace( '/\s+/', '', sanitize_user( $user, true ) );
$user_email = sanitize_email( $user_email );
$key = substr( md5( time() . rand() . $user_email ), 0, 16 );
$key = substr( md5( time() . wp_rand() . $user_email ), 0, 16 );
$meta = serialize($meta);
$wpdb->insert( $wpdb->signups, array(