Make WordPress Core

Ticket #31870: 31870.2.patch

File 31870.2.patch, 1.5 KB (added by ramiy, 10 years ago)
  • user-functions.php

     
    136136
    137137        $user = get_user_by('login', $username);
    138138
    139         if ( !$user )
    140                 return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s">Lost your password?</a>' ), wp_lostpassword_url() ) );
     139        if ( !$user ) {
     140                return new WP_Error( 'invalid_username',
     141                        __( '<strong>ERROR</strong>: Invalid username.' ) .
     142                        ' <a href="' . wp_lostpassword_url() . '">' .
     143                        __( 'Lost your password?' ) .
     144                        '</a>'
     145                );
     146        }
    141147
    142148        /**
    143149         * Filter whether the given user can be authenticated with the provided $password.
     
    152158        if ( is_wp_error($user) )
    153159                return $user;
    154160
    155         if ( !wp_check_password($password, $user->user_pass, $user->ID) )
    156                 return new WP_Error( 'incorrect_password', sprintf( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s">Lost your password?</a>' ),
    157                 $username, wp_lostpassword_url() ) );
     161        if ( !wp_check_password( $password, $user->user_pass, $user->ID ) ) {
     162                return new WP_Error( 'incorrect_password',
     163                        sprintf(
     164                                /* translators: %s: user name */
     165                                __( '<strong>ERROR</strong>: The password you entered for the username %s is incorrect.' ),
     166                                '<strong>' . $username . '</strong>',
     167                        ) .
     168                        ' <a href="' . wp_lostpassword_url() . '">' .
     169                        __( 'Lost your password?' ) .
     170                        '</a>'
     171                );
     172        }
    158173
    159174        return $user;
    160175}