WordPress.org

Make WordPress Core

Ticket #14290: 14290.2.diff

File 14290.2.diff, 592 bytes (added by coffee2code, 11 years ago)

Updated patch that accounts for potential 0 return value

  • wp-login.php

     
    323323
    324324        $user_pass = wp_generate_password( 12, false);
    325325        $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
    326         if ( ! $user_id ) {
     326        if ( ! $user_id || is_wp_error( $user_id ) ) {
    327327                $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn&#8217;t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );
    328328                return $errors;
    329329        }