mirror of
https://github.com/WordPress/WordPress.git
synced 2024-11-05 18:32:23 +01:00
Check for a WP_Error return from wp_create_user() in register_new_user().
props coffee2code. fixes #14290. Built from https://develop.svn.wordpress.org/trunk@25174 git-svn-id: http://core.svn.wordpress.org/trunk@25148 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
cb154ad4f5
commit
cf02025fe0
@ -353,7 +353,7 @@ function register_new_user( $user_login, $user_email ) {
|
|||||||
|
|
||||||
$user_pass = wp_generate_password( 12, false);
|
$user_pass = wp_generate_password( 12, false);
|
||||||
$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
|
$user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
|
||||||
if ( ! $user_id ) {
|
if ( ! $user_id || is_wp_error( $user_id ) ) {
|
||||||
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
|
$errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
|
||||||
return $errors;
|
return $errors;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user