Make WordPress Core

Ticket #42183: 42183.patch

File 42183.patch, 916 bytes (added by rinkuyadav999, 8 years ago)
  • src/wp-includes/user.php

     
    18201820        // Escape data pulled from DB.
    18211821        $user = add_magic_quotes( $user );
    18221822
    1823         if ( ! empty( $userdata['user_pass'] ) && $userdata['user_pass'] !== $user_obj->user_pass ) {
    1824                 // If password is changing, hash it now
     1823        if ( empty( $wp_hasher ) ) {
     1824                require_once( ABSPATH . WPINC . '/class-phpass.php');
     1825                // By default, use the portable hash from phpass.
     1826                $wp_hasher = new PasswordHash( 8, true );
     1827        }
     1828
     1829        if ( ! empty( $userdata['user_pass'] ) && false === $wp_hasher->CheckPassword( $userdata['user_pass'], $user_obj->user_pass ) ) {
     1830                // If password is changing, hash it now.
    18251831                $plaintext_pass = $userdata['user_pass'];
    18261832                $userdata['user_pass'] = wp_hash_password( $userdata['user_pass'] );
    18271833