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

Props ramiy.
Fixes #31870.

git-svn-id: https://develop.svn.wordpress.org/trunk@34354 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Dominik Schilling (ocean90) 2015-09-20 09:10:59 +00:00
parent fe80bec9ee
commit ce1832f49c
1 changed files with 20 additions and 5 deletions

View File

@ -136,8 +136,14 @@ function wp_authenticate_username_password($user, $username, $password) {
$user = get_user_by('login', $username);
if ( !$user )
return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s">Lost your password?</a>' ), wp_lostpassword_url() ) );
if ( !$user ) {
return new WP_Error( 'invalid_username',
__( '<strong>ERROR</strong>: Invalid username.' ) .
' <a href="' . wp_lostpassword_url() . '">' .
__( 'Lost your password?' ) .
'</a>'
);
}
/**
* Filter whether the given user can be authenticated with the provided $password.
@ -152,9 +158,18 @@ function wp_authenticate_username_password($user, $username, $password) {
if ( is_wp_error($user) )
return $user;
if ( !wp_check_password($password, $user->user_pass, $user->ID) )
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>' ),
$username, wp_lostpassword_url() ) );
if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) {
return new WP_Error( 'incorrect_password',
sprintf(
/* translators: %s: user name */
__( '<strong>ERROR</strong>: The password you entered for the username %s is incorrect.' ),
'<strong>' . $username . '</strong>'
) .
' <a href="' . wp_lostpassword_url() . '">' .
__( 'Lost your password?' ) .
'</a>'
);
}
return $user;
}