mirror of
https://github.com/WordPress/WordPress.git
synced 2025-01-03 06:57:35 +01:00
Deprecate generate_random_password(). fixes #11746
git-svn-id: http://svn.automattic.com/wordpress/trunk@12624 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
eea7c0ee49
commit
ce33a91f95
@ -157,7 +157,7 @@ switch( $_GET['action'] ) {
|
||||
$password = 'N/A';
|
||||
$user_id = email_exists($email);
|
||||
if( !$user_id ) { // Create a new user with a random password
|
||||
$password = generate_random_password();
|
||||
$password = wp_generate_password();
|
||||
$user_id = wpmu_create_user( $domain, $password, $email );
|
||||
if(false == $user_id) {
|
||||
wp_die( __('There was an error creating the user') );
|
||||
|
10
wp-includes/ms-deprecated.php
Normal file
10
wp-includes/ms-deprecated.php
Normal file
@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
function generate_random_password( $len = 8 ) {
|
||||
_deprecated_function( __FUNCTION__, '3.0', 'wp_generarte_password()' );
|
||||
$random_password = substr(md5(uniqid(microtime())), 0, intval( $len ) );
|
||||
$random_password = apply_filters('random_password', $random_password);
|
||||
return $random_password;
|
||||
}
|
||||
|
||||
?>
|
@ -1214,7 +1214,7 @@ function wpmu_activate_signup($key) {
|
||||
$user_login = $wpdb->escape($signup->user_login);
|
||||
$user_email = $wpdb->escape($signup->user_email);
|
||||
wpmu_validate_user_signup($user_login, $user_email);
|
||||
$password = generate_random_password();
|
||||
$password = wp_generate_password();
|
||||
|
||||
$user_id = username_exists($user_login);
|
||||
|
||||
@ -1268,12 +1268,6 @@ function wpmu_activate_signup($key) {
|
||||
return array('blog_id' => $blog_id, 'user_id' => $user_id, 'password' => $password, 'title' => $signup->title, 'meta' => $meta);
|
||||
}
|
||||
|
||||
function generate_random_password( $len = 8 ) {
|
||||
$random_password = substr(md5(uniqid(microtime())), 0, intval( $len ) );
|
||||
$random_password = apply_filters('random_password', $random_password);
|
||||
return $random_password;
|
||||
}
|
||||
|
||||
function wpmu_create_user( $user_name, $password, $email) {
|
||||
$user_name = preg_replace( "/\s+/", '', sanitize_user( $user_name, true ) );
|
||||
if ( username_exists($user_name) )
|
||||
|
@ -405,6 +405,7 @@ require (ABSPATH . WPINC . '/widgets.php');
|
||||
if ( is_multisite() ) {
|
||||
require_once( ABSPATH . WPINC . '/ms-functions.php' );
|
||||
require_once( ABSPATH . WPINC . '/ms-default-filters.php' );
|
||||
require_once( ABSPATH . WPINC . '/ms-deprecated.php' );
|
||||
}
|
||||
|
||||
if ( !defined('WP_CONTENT_URL') )
|
||||
|
Loading…
Reference in New Issue
Block a user