Check for a WP_Error return from wp_create_user() in register_new_user().

props coffee2code.
fixes #14290.


git-svn-id: https://develop.svn.wordpress.org/trunk@25174 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Nacin 2013-08-29 22:15:06 +00:00
parent 0494df8152
commit 7e5192393a
1 changed files with 1 additions and 1 deletions

View File

@ -353,7 +353,7 @@ function register_new_user( $user_login, $user_email ) {
$user_pass = wp_generate_password( 12, false);
$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&#8217;t register you&hellip; please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
return $errors;
}