WordPress.org

Make WordPress Core

Ticket #41522: 41522.diff

File 41522.diff, 687 bytes (added by henry.wright, 4 years ago)
  • src/wp-includes/pluggable.php

    diff --git src/wp-includes/pluggable.php src/wp-includes/pluggable.php
    index 4a4776b..ab90063 100644
    if ( !function_exists('wp_set_password') ) : 
    24022402 * @param int    $user_id  User ID
    24032403 */
    24042404function wp_set_password( $password, $user_id ) {
    2405         global $wpdb;
    2406 
    2407         $hash = wp_hash_password( $password );
    2408         $wpdb->update($wpdb->users, array('user_pass' => $hash, 'user_activation_key' => ''), array('ID' => $user_id) );
     2405        wp_update_user( array(
     2406                'ID'                  => $user_id,
     2407                'user_pass'           => $password,
     2408                'user_activation_key' => ''
     2409        ) );
    24092410
    24102411        wp_cache_delete($user_id, 'users');
    24112412}