From d2414cbd2fd5cce17d16bfdc8e41a14e847b0d3f Mon Sep 17 00:00:00 2001 From: Dominik Schilling Date: Sun, 20 Sep 2015 09:11:24 +0000 Subject: [PATCH] Login: Move the "Lost your password?" link into a separate string to reduce HTML tags in translation strings. Props ramiy. Fixes #31870. Built from https://develop.svn.wordpress.org/trunk@34354 git-svn-id: http://core.svn.wordpress.org/trunk@34318 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/user-functions.php | 25 ++++++++++++++++++++----- wp-includes/version.php | 2 +- 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/wp-includes/user-functions.php b/wp-includes/user-functions.php index 856ca673c8..701e38cf34 100644 --- a/wp-includes/user-functions.php +++ b/wp-includes/user-functions.php @@ -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( __( 'ERROR: Invalid username. Lost your password?' ), wp_lostpassword_url() ) ); + if ( !$user ) { + return new WP_Error( 'invalid_username', + __( 'ERROR: Invalid username.' ) . + ' ' . + __( 'Lost your password?' ) . + '' + ); + } /** * 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( __( 'ERROR: The password you entered for the username %1$s is incorrect. Lost your password?' ), - $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 */ + __( 'ERROR: The password you entered for the username %s is incorrect.' ), + '' . $username . '' + ) . + ' ' . + __( 'Lost your password?' ) . + '' + ); + } return $user; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 7dd46ec473..aca21b9f0a 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34353'; +$wp_version = '4.4-alpha-34354'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.