diff --git a/src/wp-admin/includes/privacy-tools.php b/src/wp-admin/includes/privacy-tools.php
index f974ea8a5d..e75fbaabb4 100644
a
|
b
|
function _wp_personal_data_handle_actions() { |
125 | 125 | 'error' |
126 | 126 | ); |
127 | 127 | } |
128 | | |
| 128 | |
| 129 | // Checking a username exists or not while entering a username. |
129 | 130 | if ( ! is_email( $username_or_email_address ) ) { |
130 | 131 | $user = get_user_by( 'login', $username_or_email_address ); |
131 | 132 | if ( ! $user instanceof WP_User ) { |
… |
… |
function _wp_personal_data_handle_actions() { |
141 | 142 | } else { |
142 | 143 | $email_address = $username_or_email_address; |
143 | 144 | } |
| 145 | |
| 146 | // Checking a email id exists or not while entering a email id. |
| 147 | if ( ! empty( $email_address ) && is_email( $email_address ) ) { |
144 | 148 | |
| 149 | $user = get_user_by( 'email', $email_address ); |
| 150 | if ( ! $user instanceof WP_User ) { |
| 151 | add_settings_error( |
| 152 | 'username_or_email_for_privacy_request', |
| 153 | 'username_or_email_for_privacy_request', |
| 154 | __( 'Unable to add this request. A valid email address or username must be supplied.' ), |
| 155 | 'error' |
| 156 | ); |
| 157 | $email_address = ''; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | // Strongly checking to user email id should not empty. |
145 | 162 | if ( empty( $email_address ) ) { |
146 | 163 | break; |
147 | 164 | } |