Ticket #40888: 40888.patch
File 40888.patch, 1.6 KB (added by , 7 years ago) |
---|
-
src/wp-login.php
285 285 function retrieve_password() { 286 286 $errors = new WP_Error(); 287 287 288 if ( empty( $_POST['user_login'] ) ) { 288 if ( ! is_string ($_POST['user_login'] ) ) { 289 $errors->add('username_not_string', __('<strong>ERROR</strong>: Enter a string value of username or email address.')); 290 } elseif ( empty( $_POST['user_login'] ) ) { 289 291 $errors->add('empty_username', __('<strong>ERROR</strong>: Enter a username or email address.')); 290 292 } elseif ( strpos( $_POST['user_login'], '@' ) ) { 291 293 $user_data = get_user_by( 'email', trim( wp_unslash( $_POST['user_login'] ) ) ); … … 528 530 529 531 login_header(__('Lost Password'), '<p class="message">' . __('Please enter your username or email address. You will receive a link to create a new password via email.') . '</p>', $errors); 530 532 531 $user_login = isset($_POST['user_login']) ? wp_unslash($_POST['user_login']) : '';533 $user_login = isset($_POST['user_login']) && is_string($_POST['user_login']) ? wp_unslash($_POST['user_login']) : ''; 532 534 533 535 ?> 534 536 … … 698 700 $user_login = ''; 699 701 $user_email = ''; 700 702 if ( $http_post ) { 701 $user_login = isset( $_POST['user_login'] ) ? $_POST['user_login'] : '';703 $user_login = isset( $_POST['user_login'] ) && is_string( $_POST['user_login']) ? $_POST['user_login'] : ''; 702 704 $user_email = isset( $_POST['user_email'] ) ? wp_unslash( $_POST['user_email'] ) : ''; 703 705 $errors = register_new_user($user_login, $user_email); 704 706 if ( !is_wp_error($errors) ) {