From 116a5c2fa7852bbfe97760e39ee2666b902c774b Mon Sep 17 00:00:00 2001 From: Jeremy Felt Date: Wed, 11 Jan 2017 05:32:07 +0000 Subject: [PATCH] Multisite: Use `wp_rand()` in signup key creation. Merges [39795] to the 4.6 branch. Built from https://develop.svn.wordpress.org/branches/4.6@39797 git-svn-id: http://core.svn.wordpress.org/branches/4.6@39735 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/ms-functions.php | 4 ++-- wp-includes/version.php | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/wp-includes/ms-functions.php b/wp-includes/ms-functions.php index a253a61dac..3f5ee2c92a 100644 --- a/wp-includes/ms-functions.php +++ b/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( diff --git a/wp-includes/version.php b/wp-includes/version.php index 10ed1b6eda..8ac911c241 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.6.2-alpha-39785'; +$wp_version = '4.6.2-alpha-39797'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.