WordPress.org

Make WordPress Core

Ticket #21495: 21495.patch

File 21495.patch, 545 bytes (added by ancawonka, 9 years ago)

Now checking for empty (or undefined) passwords in wp_create_user

  • wp-includes/user.php

     
    12551255                $old_user_data = WP_User::get_data_by( 'id', $ID );
    12561256        } else {
    12571257                $update = false;
     1258                // check for a password
     1259                if ( !isset($user_pass) || empty($user_pass) ){
     1260                        return new WP_Error('empty_user_password', __('Cannot create a user with an empty password.') );
     1261                }
    12581262                // Hash the password
    12591263                $user_pass = wp_hash_password($user_pass);
    12601264        }