Ticket #31870: 31870.2.patch
File 31870.2.patch, 1.5 KB (added by , 10 years ago) |
---|
-
user-functions.php
136 136 137 137 $user = get_user_by('login', $username); 138 138 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 } 141 147 142 148 /** 143 149 * Filter whether the given user can be authenticated with the provided $password. … … 152 158 if ( is_wp_error($user) ) 153 159 return $user; 154 160 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 } 158 173 159 174 return $user; 160 175 }