WordPress.org

Make WordPress Core

Ticket #24465: 24465.patch

File 24465.patch, 1.2 KB (added by jfarthing84, 8 years ago)
  • wp-login.php

     
    323323
    324324        $sanitized_user_login = sanitize_user( $user_login );
    325325        $user_email = apply_filters( 'user_registration_email', $user_email );
     326        $user_pass  = apply_filters( 'user_registration_password', wp_generate_password( 12, false ) );
    326327
    327328        // Check the username
    328329        if ( $sanitized_user_login == '' ) {
     
    346347
    347348        do_action( 'register_post', $sanitized_user_login, $user_email, $errors );
    348349
    349         $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email );
     350        $errors = apply_filters( 'registration_errors', $errors, $sanitized_user_login, $user_email, $user_pass );
    350351
    351352        if ( $errors->get_error_code() )
    352353                return $errors;
    353354
    354         $user_pass = wp_generate_password( 12, false);
    355355        $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
    356356        if ( ! $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' ) ) );