diff --git a/wp-includes/user.php b/wp-includes/user.php
index 566702f4fc..1ce9bb6479 100644
a
|
b
|
function wp_authenticate_username_password( $user, $username, $password ) { |
138 | 138 | $error = new WP_Error(); |
139 | 139 | |
140 | 140 | if ( empty( $username ) ) { |
141 | | $error->add( 'empty_username', __( '<strong>ERROR</strong>: The username field is empty.' ) ); |
| 141 | $error->add( 'empty_username', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'The username field is empty.' ) ) ); |
142 | 142 | } |
143 | 143 | |
144 | 144 | if ( empty( $password ) ) { |
145 | | $error->add( 'empty_password', __( '<strong>ERROR</strong>: The password field is empty.' ) ); |
| 145 | $error->add( 'empty_password', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'The password field is empty.' ) ) ); |
146 | 146 | } |
147 | 147 | |
148 | 148 | return $error; |
… |
… |
function wp_authenticate_username_password( $user, $username, $password ) { |
152 | 152 | |
153 | 153 | if ( ! $user ) { |
154 | 154 | return new WP_Error( |
155 | | 'invalid_username', |
156 | | __( '<strong>ERROR</strong>: Invalid username.' ) . |
| 155 | 'invalid_username', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'Invalid username.' ) ) . |
157 | 156 | ' <a href="' . wp_lostpassword_url() . '">' . |
158 | 157 | __( 'Lost your password?' ) . |
159 | 158 | '</a>' |
… |
… |
function wp_authenticate_username_password( $user, $username, $password ) { |
177 | 176 | if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) { |
178 | 177 | return new WP_Error( |
179 | 178 | 'incorrect_password', |
180 | | sprintf( |
181 | | /* translators: %s: user name */ |
182 | | __( '<strong>ERROR</strong>: The password you entered for the username %s is incorrect.' ), |
183 | | '<strong>' . $username . '</strong>' |
184 | | ) . |
| 179 | sprintf( |
| 180 | '<strong>%s</strong>: %s <strong>%s</strong> %s', |
| 181 | __( 'ERROR' ), |
| 182 | __( 'The password you entered for the username' ), |
| 183 | $username, |
| 184 | __( 'is incorrect.' ) |
| 185 | ) . |
185 | 186 | ' <a href="' . wp_lostpassword_url() . '">' . |
186 | 187 | __( 'Lost your password?' ) . |
187 | 188 | '</a>' |
… |
… |
function wp_authenticate_email_password( $user, $email, $password ) { |
215 | 216 | $error = new WP_Error(); |
216 | 217 | |
217 | 218 | if ( empty( $email ) ) { |
218 | | $error->add( 'empty_username', __( '<strong>ERROR</strong>: The email field is empty.' ) ); // Uses 'empty_username' for back-compat with wp_signon() |
| 219 | $error->add( 'empty_username', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'The email field is empty.' ) ) ); // Uses 'empty_username' for back-compat with wp_signon() |
219 | 220 | } |
220 | 221 | |
221 | 222 | if ( empty( $password ) ) { |
222 | | $error->add( 'empty_password', __( '<strong>ERROR</strong>: The password field is empty.' ) ); |
| 223 | $error->add( 'empty_password', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'The password field is empty.' ) ) ); |
223 | 224 | } |
224 | 225 | |
225 | 226 | return $error; |
… |
… |
function wp_authenticate_email_password( $user, $email, $password ) { |
234 | 235 | if ( ! $user ) { |
235 | 236 | return new WP_Error( |
236 | 237 | 'invalid_email', |
237 | | __( '<strong>ERROR</strong>: Invalid email address.' ) . |
| 238 | sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'Invalid email address.' ) ) . |
238 | 239 | ' <a href="' . wp_lostpassword_url() . '">' . |
239 | 240 | __( 'Lost your password?' ) . |
240 | 241 | '</a>' |
… |
… |
function wp_authenticate_email_password( $user, $email, $password ) { |
251 | 252 | if ( ! wp_check_password( $password, $user->user_pass, $user->ID ) ) { |
252 | 253 | return new WP_Error( |
253 | 254 | 'incorrect_password', |
254 | | sprintf( |
255 | | /* translators: %s: email address */ |
256 | | __( '<strong>ERROR</strong>: The password you entered for the email address %s is incorrect.' ), |
257 | | '<strong>' . $email . '</strong>' |
258 | | ) . |
| 255 | sprintf( |
| 256 | '<strong>%s</strong>: %s <strong>%s</strong> %s', |
| 257 | __( 'ERROR' ), |
| 258 | __( 'The password you entered for the email address' ), |
| 259 | $email, |
| 260 | __( 'is incorrect.' ) |
| 261 | ) . |
259 | 262 | ' <a href="' . wp_lostpassword_url() . '">' . |
260 | 263 | __( 'Lost your password?' ) . |
261 | 264 | '</a>' |
… |
… |
function wp_authenticate_spam_check( $user ) { |
328 | 331 | $spammed = apply_filters( 'check_is_user_spammed', is_user_spammy( $user ), $user ); |
329 | 332 | |
330 | 333 | if ( $spammed ) { |
331 | | return new WP_Error( 'spammer_account', __( '<strong>ERROR</strong>: Your account has been marked as a spammer.' ) ); |
| 334 | return new WP_Error( 'spammer_account', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'Your account has been marked as a spammer.' ) ) ); |
332 | 335 | } |
333 | 336 | } |
334 | 337 | return $user; |
… |
… |
function register_new_user( $user_login, $user_email ) { |
2413 | 2416 | |
2414 | 2417 | // Check the username |
2415 | 2418 | if ( $sanitized_user_login == '' ) { |
2416 | | $errors->add( 'empty_username', __( '<strong>ERROR</strong>: Please enter a username.' ) ); |
| 2419 | $errors->add( 'empty_username', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'Please enter a username.' ) ) ); |
2417 | 2420 | } elseif ( ! validate_username( $user_login ) ) { |
2418 | | $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); |
| 2421 | $errors->add( 'invalid_username', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'This username is invalid because it uses illegal characters. Please enter a valid username.' ) ) ); |
2419 | 2422 | $sanitized_user_login = ''; |
2420 | 2423 | } elseif ( username_exists( $sanitized_user_login ) ) { |
2421 | | $errors->add( 'username_exists', __( '<strong>ERROR</strong>: This username is already registered. Please choose another one.' ) ); |
| 2424 | $errors->add( 'username_exists', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'This username is already registered. Please choose another one.' ) ) ); |
2422 | 2425 | |
2423 | 2426 | } else { |
2424 | 2427 | /** This filter is documented in wp-includes/user.php */ |
2425 | 2428 | $illegal_user_logins = array_map( 'strtolower', (array) apply_filters( 'illegal_user_logins', array() ) ); |
2426 | 2429 | if ( in_array( strtolower( $sanitized_user_login ), $illegal_user_logins ) ) { |
2427 | | $errors->add( 'invalid_username', __( '<strong>ERROR</strong>: Sorry, that username is not allowed.' ) ); |
| 2430 | $errors->add( 'invalid_username', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( ' Sorry, that username is not allowed.' ) ) ); |
2428 | 2431 | } |
2429 | 2432 | } |
2430 | 2433 | |
2431 | 2434 | // Check the email address |
2432 | 2435 | if ( $user_email == '' ) { |
2433 | | $errors->add( 'empty_email', __( '<strong>ERROR</strong>: Please type your email address.' ) ); |
| 2436 | $errors->add( 'empty_email', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'Please type your email address.' ) ) ); |
2434 | 2437 | } elseif ( ! is_email( $user_email ) ) { |
2435 | | $errors->add( 'invalid_email', __( '<strong>ERROR</strong>: The email address isn’t correct.' ) ); |
| 2438 | $errors->add( 'invalid_email', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'The email address isn’t correct.' ) ) ); |
2436 | 2439 | $user_email = ''; |
2437 | 2440 | } elseif ( email_exists( $user_email ) ) { |
2438 | | $errors->add( 'email_exists', __( '<strong>ERROR</strong>: This email is already registered, please choose another one.' ) ); |
| 2441 | $errors->add( 'email_exists', sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'This email is already registered, please choose another one.' ) ) ); |
2439 | 2442 | } |
2440 | 2443 | |
2441 | 2444 | /** |
… |
… |
function register_new_user( $user_login, $user_email ) { |
2478 | 2481 | if ( ! $user_id || is_wp_error( $user_id ) ) { |
2479 | 2482 | $errors->add( 'registerfail', sprintf( __( '<strong>ERROR</strong>: Couldn’t register you… please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) ); |
2480 | 2483 | return $errors; |
| 2484 | |
2481 | 2485 | } |
2482 | 2486 | |
2483 | 2487 | update_user_option( $user_id, 'default_password_nag', true, true ); //Set up the Password change nag. |
… |
… |
function send_confirmation_on_profile_email() { |
2707 | 2711 | if ( $current_user->user_email != $_POST['email'] ) { |
2708 | 2712 | if ( ! is_email( $_POST['email'] ) ) { |
2709 | 2713 | $errors->add( |
2710 | | 'user_email', __( '<strong>ERROR</strong>: The email address isn’t correct.' ), array( |
| 2714 | 'user_email', |
| 2715 | sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'The email address isn’t correct.' ) ), |
| 2716 | array( |
2711 | 2717 | 'form-field' => 'email', |
2712 | 2718 | ) |
2713 | 2719 | ); |
… |
… |
function send_confirmation_on_profile_email() { |
2717 | 2723 | |
2718 | 2724 | if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST['email'] ) ) ) { |
2719 | 2725 | $errors->add( |
2720 | | 'user_email', __( '<strong>ERROR</strong>: The email address is already used.' ), array( |
| 2726 | 'user_email', |
| 2727 | sprintf( '<strong>%s</strong>: %s', __( 'ERROR' ), __( 'The email address is already used.' ) ), |
| 2728 | array( |
2721 | 2729 | 'form-field' => 'email', |
2722 | 2730 | ) |
2723 | 2731 | ); |