Ticket #29955: 29955.login-errors.patch
File 29955.login-errors.patch, 2.6 KB (added by , 10 years ago) |
---|
-
src/wp-includes/user.php
134 134 $user = get_user_by('login', $username); 135 135 136 136 if ( !$user ) 137 return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s">Lost your password </a>?' ), wp_lostpassword_url() ) );137 return new WP_Error( 'invalid_username', sprintf( __( '<strong>ERROR</strong>: Invalid username. <a href="%s">Lost your password?</a>' ), wp_lostpassword_url() ) ); 138 138 139 139 /** 140 140 * Filter whether the given user can be authenticated with the provided $password. … … 150 150 return $user; 151 151 152 152 if ( !wp_check_password($password, $user->user_pass, $user->ID) ) 153 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>?' ),153 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>' ), 154 154 $username, wp_lostpassword_url() ) ); 155 155 156 156 return $user; -
src/wp-login.php
870 870 if ( isset($_POST['log']) ) 871 871 $user_login = ( 'incorrect_password' == $errors->get_error_code() || 'empty_password' == $errors->get_error_code() ) ? esc_attr(wp_unslash($_POST['log'])) : ''; 872 872 $rememberme = ! empty( $_POST['rememberme'] ); 873 874 ! empty( $errors->errors ) ? $aria_describedby_error = ' aria-describedby="login_error"' : $aria_describedby_error = ''; 873 875 ?> 874 876 875 877 <form name="loginform" id="loginform" action="<?php echo esc_url( site_url( 'wp-login.php', 'login_post' ) ); ?>" method="post"> 876 878 <p> 877 879 <label for="user_login"><?php _e('Username') ?><br /> 878 <input type="text" name="log" id="user_login" class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label>880 <input type="text" name="log" id="user_login"<?php echo $aria_describedby_error ?> class="input" value="<?php echo esc_attr($user_login); ?>" size="20" /></label> 879 881 </p> 880 882 <p> 881 883 <label for="user_pass"><?php _e('Password') ?><br /> 882 <input type="password" name="pwd" id="user_pass" class="input" value="" size="20" /></label>884 <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error ?> class="input" value="" size="20" /></label> 883 885 </p> 884 886 <?php 885 887 /**