From e6a894dc680d6ca7dda11d667b300c6041b5a29d Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 11 Jan 2017 05:34:02 +0000 Subject: [PATCH] Multisite: Use `wp_rand()` in signup key creation. Merges [39795] to the 4.4 branch. Built from https://develop.svn.wordpress.org/branches/4.4@39799 git-svn-id: http://core.svn.wordpress.org/branches/4.4@39737 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index f41d2b67c7..2441ae7228 100644 --- a/wp-includes/ms-functions.php +++ b/wp-includes/ms-functions.php @@ -666,7 +666,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( @@ -716,7 +716,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(