Make WordPress Core


Ignore:
Timestamp:
09/20/2015 09:10:59 AM (9 years ago)
Author:
ocean90
Message:

Login: Move the "Lost your password?" link into a separate string to reduce HTML tags in translation strings.

Props ramiy.
Fixes #31870.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/user-functions.php

    r34318 r34354  
    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    /**
     
    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;
Note: See TracChangeset for help on using the changeset viewer.