WordPress.org

Make WordPress Core

Changeset 25174


Ignore:
Timestamp:
08/29/2013 10:15:06 PM (8 years ago)
Author:
nacin
Message:

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

props coffee2code.
fixes #14290.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-login.php

    r25045 r25174  
    354354    $user_pass = wp_generate_password( 12, false);
    355355    $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
    356     if ( ! $user_id ) {
     356    if ( ! $user_id || is_wp_error( $user_id ) ) {
    357357        $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' ) ) );
    358358        return $errors;
Note: See TracChangeset for help on using the changeset viewer.