From dfa88bd587e8998de771af6e1619b91260365726 Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 11 Jan 2017 05:30:21 +0000 Subject: [PATCH] Multisite: Use `wp_rand()` in signup key creation. Merges [39795] to the 4.7 branch. git-svn-id: https://develop.svn.wordpress.org/branches/4.7@39796 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/ms-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/wp-includes/ms-functions.php b/src/wp-includes/ms-functions.php index 2e9ca946d9..7e1607ed56 100644 --- a/src/wp-includes/ms-functions.php +++ b/src/wp-includes/ms-functions.php @@ -669,7 +669,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( @@ -719,7 +719,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(