Make WordPress Core

Ticket #13324: 13324.2.diff

File 13324.2.diff, 4.1 KB (added by Otto42, 14 years ago)

Patch that changes everywhere a new user is created

  • wp-login.php

     
    231231                return new WP_Error('invalid_key', __('Invalid key'));
    232232
    233233        // Generate something random for a password...
    234         $new_pass = wp_generate_password();
     234        $new_pass = wp_generate_password(12,false);
    235235
    236236        do_action('password_reset', $user, $new_pass);
    237237
     
    301301        if ( $errors->get_error_code() )
    302302                return $errors;
    303303
    304         $user_pass = wp_generate_password();
     304        $user_pass = wp_generate_password(12,false);
    305305        $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email );
    306306        if ( ! $user_id ) {
    307307                $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' ) ) );
  • wp-includes/ms-functions.php

     
    727727        $user_login = $wpdb->escape($signup->user_login);
    728728        $user_email = $wpdb->escape($signup->user_email);
    729729        wpmu_validate_user_signup($user_login, $user_email);
    730         $password = wp_generate_password();
     730        $password = wp_generate_password(12,false);
    731731
    732732        $user_id = username_exists($user_login);
    733733
  • wp-admin/ms-edit.php

     
    173173                $password = 'N/A';
    174174                $user_id = email_exists($email);
    175175                if ( !$user_id ) { // Create a new user with a random password
    176                         $password = wp_generate_password();
     176                        $password = wp_generate_password(12,false);
    177177                        $user_id = wpmu_create_user( $domain, $password, $email );
    178178                        if ( false == $user_id )
    179179                                wp_die( __( 'There was an error creating the user.' ) );
     
    604604                elseif ( empty($user['email']) )
    605605                        wp_die( __( 'Missing email.' ) );
    606606
    607                 $password = wp_generate_password();
     607                $password = wp_generate_password(12,false);
    608608                $user_id = wpmu_create_user( esc_html( strtolower( $user['username'] ) ), $password, esc_html( $user['email'] ) );
    609609
    610610                if ( false == $user_id )
  • wp-admin/includes/upgrade.php

     
    6464        $user_password = trim($user_password);
    6565        $email_password = false;
    6666        if ( !$user_id && empty($user_password) ) {
    67                 $user_password = wp_generate_password();
     67                $user_password = wp_generate_password(12,false);
    6868                $message = __('<strong><em>Note that password</em></strong> carefully! It is a <em>random</em> password that was generated just for you.');
    6969                $user_id = wp_create_user($user_name, $user_password, $user_email);
    7070                update_user_option($user_id, 'default_password_nag', true, true);
  • wp-admin/import/mt.php

     
    103103        //function to check the authorname and do the mapping
    104104        function checkauthor($author) {
    105105                //mtnames is an array with the names in the mt import file
    106                 $pass = wp_generate_password();
     106                $pass = wp_generate_password(12,false);
    107107                if (!(in_array($author, $this->mtnames))) { //a new mt author name is found
    108108                        ++ $this->j;
    109109                        $this->mtnames[$this->j] = $author; //add that new mt author name to an array
  • wp-admin/import/wordpress.php

     
    186186
    187187                                $user_id = username_exists($new_author_name);
    188188                                if ( !$user_id ) {
    189                                         $user_id = wp_create_user($new_author_name, wp_generate_password());
     189                                        $user_id = wp_create_user($new_author_name, wp_generate_password(12,false));
    190190                                }
    191191
    192192                                if ( !is_wp_error( $user_id ) ) {