WordPress.org

Make WordPress Core

Ticket #40046: pass_length.patch

File pass_length.patch, 893 bytes (added by 1naveengiri, 3 years ago)

Fixed in this patch.

  • wp-includes/user.php

     
    23352335        if ( $errors->get_error_code() )
    23362336                return $errors;
    23372337
    2338         $user_pass = wp_generate_password( 12, false );
     2338        /**
     2339         * Filters the password length of a user being registered.
     2340         *
     2341         * @param int $pass_length the password length.
     2342         */
     2343        $length = apply_filters( 'user_password_length', $length = 12 );
     2344
     2345        $user_pass = wp_generate_password( $length, false );
    23392346        $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
    23402347        if ( ! $user_id || is_wp_error( $user_id ) ) {
    23412348                $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' ) ) );