diff --git a/src/wp-admin/includes/file.php b/src/wp-admin/includes/file.php
index 399fdcf629..29db73767d 100644
a
|
b
|
function request_filesystem_credentials( $form_post, $type = '', $error = false, |
2326 | 2326 | $connection_type = isset( $credentials['connection_type'] ) ? $credentials['connection_type'] : ''; |
2327 | 2327 | |
2328 | 2328 | if ( $error ) { |
2329 | | $error_string = __( '<strong>Error</strong>: Could not connect to the server. Please verify the settings are correct.' ); |
| 2329 | $error_string = __( '<strong>Error:</strong> Could not connect to the server. Please verify the settings are correct.' ); |
2330 | 2330 | if ( is_wp_error( $error ) ) { |
2331 | 2331 | $error_string = esc_html( $error->get_error_message() ); |
2332 | 2332 | } |
diff --git a/src/wp-admin/includes/user.php b/src/wp-admin/includes/user.php
index ab63f9e302..b6dc7919ae 100644
a
|
b
|
function edit_user( $user_id = 0 ) { |
143 | 143 | |
144 | 144 | /* checking that username has been typed */ |
145 | 145 | if ( '' === $user->user_login ) { |
146 | | $errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) ); |
| 146 | $errors->add( 'user_login', __( '<strong>Error:</strong> Please enter a username.' ) ); |
147 | 147 | } |
148 | 148 | |
149 | 149 | /* checking that nickname has been typed */ |
150 | 150 | if ( $update && empty( $user->nickname ) ) { |
151 | | $errors->add( 'nickname', __( '<strong>Error</strong>: Please enter a nickname.' ) ); |
| 151 | $errors->add( 'nickname', __( '<strong>Error:</strong> Please enter a nickname.' ) ); |
152 | 152 | } |
153 | 153 | |
154 | 154 | /** |
… |
… |
function edit_user( $user_id = 0 ) { |
164 | 164 | |
165 | 165 | // Check for blank password when adding a user. |
166 | 166 | if ( ! $update && empty( $pass1 ) ) { |
167 | | $errors->add( 'pass', __( '<strong>Error</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) ); |
| 167 | $errors->add( 'pass', __( '<strong>Error:</strong> Please enter a password.' ), array( 'form-field' => 'pass1' ) ); |
168 | 168 | } |
169 | 169 | |
170 | 170 | // Check for "\" in password. |
171 | 171 | if ( false !== strpos( wp_unslash( $pass1 ), '\\' ) ) { |
172 | | $errors->add( 'pass', __( '<strong>Error</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) ); |
| 172 | $errors->add( 'pass', __( '<strong>Error:</strong> Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) ); |
173 | 173 | } |
174 | 174 | |
175 | 175 | // Checking the password has been typed twice the same. |
176 | 176 | if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) { |
177 | | $errors->add( 'pass', __( '<strong>Error</strong>: Passwords don’t match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) ); |
| 177 | $errors->add( 'pass', __( '<strong>Error:</strong> Passwords don’t match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) ); |
178 | 178 | } |
179 | 179 | |
180 | 180 | if ( ! empty( $pass1 ) ) { |
… |
… |
function edit_user( $user_id = 0 ) { |
182 | 182 | } |
183 | 183 | |
184 | 184 | if ( ! $update && isset( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) { |
185 | | $errors->add( 'user_login', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); |
| 185 | $errors->add( 'user_login', __( '<strong>Error:</strong> This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); |
186 | 186 | } |
187 | 187 | |
188 | 188 | if ( ! $update && username_exists( $user->user_login ) ) { |
189 | | $errors->add( 'user_login', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) ); |
| 189 | $errors->add( 'user_login', __( '<strong>Error:</strong> This username is already registered. Please choose another one.' ) ); |
190 | 190 | } |
191 | 191 | |
192 | 192 | /** This filter is documented in wp-includes/user.php */ |
193 | 193 | $illegal_logins = (array) apply_filters( 'illegal_user_logins', array() ); |
194 | 194 | |
195 | 195 | if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ), true ) ) { |
196 | | $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) ); |
| 196 | $errors->add( 'invalid_username', __( '<strong>Error:</strong> Sorry, that username is not allowed.' ) ); |
197 | 197 | } |
198 | 198 | |
199 | 199 | /* checking email address */ |
200 | 200 | if ( empty( $user->user_email ) ) { |
201 | | $errors->add( 'empty_email', __( '<strong>Error</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) ); |
| 201 | $errors->add( 'empty_email', __( '<strong>Error:</strong> Please enter an email address.' ), array( 'form-field' => 'email' ) ); |
202 | 202 | } elseif ( ! is_email( $user->user_email ) ) { |
203 | | $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn’t correct.' ), array( 'form-field' => 'email' ) ); |
| 203 | $errors->add( 'invalid_email', __( '<strong>Error:</strong> The email address isn’t correct.' ), array( 'form-field' => 'email' ) ); |
204 | 204 | } else { |
205 | 205 | $owner_id = email_exists( $user->user_email ); |
206 | 206 | if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) { |
207 | | $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) ); |
| 207 | $errors->add( 'email_exists', __( '<strong>Error:</strong> This email is already registered. Please choose another one.' ), array( 'form-field' => 'email' ) ); |
208 | 208 | } |
209 | 209 | } |
210 | 210 | |
diff --git a/src/wp-admin/options.php b/src/wp-admin/options.php
index 019f9529c4..1ee1be57e5 100644
a
|
b
|
if ( 'update' === $action ) { // We are saving settings sent from a settings pag |
238 | 238 | wp_die( |
239 | 239 | sprintf( |
240 | 240 | /* translators: %s: The options page name. */ |
241 | | __( '<strong>Error</strong>: Options page %s not found in the allowed options list.' ), |
| 241 | __( '<strong>Error:</strong> Options page %s not found in the allowed options list.' ), |
242 | 242 | '<code>' . esc_html( $option_page ) . '</code>' |
243 | 243 | ) |
244 | 244 | ); |
diff --git a/src/wp-admin/setup-config.php b/src/wp-admin/setup-config.php
index 881398ff57..2b61fe643c 100644
a
|
b
|
switch ( $step ) { |
277 | 277 | $tryagain_link = '</p><p class="step"><a href="' . $step_1 . '" onclick="javascript:history.go(-1);return false;" class="button button-large">' . __( 'Try Again' ) . '</a>'; |
278 | 278 | |
279 | 279 | if ( empty( $prefix ) ) { |
280 | | wp_die( __( '<strong>Error</strong>: "Table Prefix" must not be empty.' ) . $tryagain_link ); |
| 280 | wp_die( __( '<strong>Error:</strong> "Table Prefix" must not be empty.' ) . $tryagain_link ); |
281 | 281 | } |
282 | 282 | |
283 | 283 | // Validate $prefix: it can only contain letters, numbers and underscores. |
284 | 284 | if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) { |
285 | | wp_die( __( '<strong>Error</strong>: "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link ); |
| 285 | wp_die( __( '<strong>Error:</strong> "Table Prefix" can only contain numbers, letters, and underscores.' ) . $tryagain_link ); |
286 | 286 | } |
287 | 287 | |
288 | 288 | // Test the DB connection. |
… |
… |
switch ( $step ) { |
315 | 315 | $wpdb->show_errors( $errors ); |
316 | 316 | if ( ! $wpdb->last_error ) { |
317 | 317 | // MySQL was able to parse the prefix as a value, which we don't want. Bail. |
318 | | wp_die( __( '<strong>Error</strong>: "Table Prefix" is invalid.' ) ); |
| 318 | wp_die( __( '<strong>Error:</strong> "Table Prefix" is invalid.' ) ); |
319 | 319 | } |
320 | 320 | |
321 | 321 | // Generate keys and salts using secure CSPRNG; fallback to API if enabled; further fallback to original wp_generate_password(). |
diff --git a/src/wp-includes/comment.php b/src/wp-includes/comment.php
index c2892f16b1..35895404de 100644
a
|
b
|
function wp_check_comment_data_max_lengths( $comment_data ) { |
1296 | 1296 | $max_lengths = wp_get_comment_fields_max_lengths(); |
1297 | 1297 | |
1298 | 1298 | if ( isset( $comment_data['comment_author'] ) && mb_strlen( $comment_data['comment_author'], '8bit' ) > $max_lengths['comment_author'] ) { |
1299 | | return new WP_Error( 'comment_author_column_length', __( '<strong>Error</strong>: Your name is too long.' ), 200 ); |
| 1299 | return new WP_Error( 'comment_author_column_length', __( '<strong>Error:</strong> Your name is too long.' ), 200 ); |
1300 | 1300 | } |
1301 | 1301 | |
1302 | 1302 | if ( isset( $comment_data['comment_author_email'] ) && strlen( $comment_data['comment_author_email'] ) > $max_lengths['comment_author_email'] ) { |
1303 | | return new WP_Error( 'comment_author_email_column_length', __( '<strong>Error</strong>: Your email address is too long.' ), 200 ); |
| 1303 | return new WP_Error( 'comment_author_email_column_length', __( '<strong>Error:</strong> Your email address is too long.' ), 200 ); |
1304 | 1304 | } |
1305 | 1305 | |
1306 | 1306 | if ( isset( $comment_data['comment_author_url'] ) && strlen( $comment_data['comment_author_url'] ) > $max_lengths['comment_author_url'] ) { |
1307 | | return new WP_Error( 'comment_author_url_column_length', __( '<strong>Error</strong>: Your URL is too long.' ), 200 ); |
| 1307 | return new WP_Error( 'comment_author_url_column_length', __( '<strong>Error:</strong> Your URL is too long.' ), 200 ); |
1308 | 1308 | } |
1309 | 1309 | |
1310 | 1310 | if ( isset( $comment_data['comment_content'] ) && mb_strlen( $comment_data['comment_content'], '8bit' ) > $max_lengths['comment_content'] ) { |
1311 | | return new WP_Error( 'comment_content_column_length', __( '<strong>Error</strong>: Your comment is too long.' ), 200 ); |
| 1311 | return new WP_Error( 'comment_content_column_length', __( '<strong>Error:</strong> Your comment is too long.' ), 200 ); |
1312 | 1312 | } |
1313 | 1313 | |
1314 | 1314 | return true; |
… |
… |
function wp_handle_comment_submission( $comment_data ) { |
3549 | 3549 | |
3550 | 3550 | if ( get_option( 'require_name_email' ) && ! $user->exists() ) { |
3551 | 3551 | if ( '' == $comment_author_email || '' == $comment_author ) { |
3552 | | return new WP_Error( 'require_name_email', __( '<strong>Error</strong>: Please fill the required fields.' ), 200 ); |
| 3552 | return new WP_Error( 'require_name_email', __( '<strong>Error:</strong> Please fill the required fields.' ), 200 ); |
3553 | 3553 | } elseif ( ! is_email( $comment_author_email ) ) { |
3554 | | return new WP_Error( 'require_valid_email', __( '<strong>Error</strong>: Please enter a valid email address.' ), 200 ); |
| 3554 | return new WP_Error( 'require_valid_email', __( '<strong>Error:</strong> Please enter a valid email address.' ), 200 ); |
3555 | 3555 | } |
3556 | 3556 | } |
3557 | 3557 | |
… |
… |
function wp_handle_comment_submission( $comment_data ) { |
3576 | 3576 | */ |
3577 | 3577 | $allow_empty_comment = apply_filters( 'allow_empty_comment', false, $commentdata ); |
3578 | 3578 | if ( '' === $comment_content && ! $allow_empty_comment ) { |
3579 | | return new WP_Error( 'require_valid_comment', __( '<strong>Error</strong>: Please type your comment text.' ), 200 ); |
| 3579 | return new WP_Error( 'require_valid_comment', __( '<strong>Error:</strong> Please type your comment text.' ), 200 ); |
3580 | 3580 | } |
3581 | 3581 | |
3582 | 3582 | $check_max_lengths = wp_check_comment_data_max_lengths( $commentdata ); |
… |
… |
function wp_handle_comment_submission( $comment_data ) { |
3590 | 3590 | } |
3591 | 3591 | |
3592 | 3592 | if ( ! $comment_id ) { |
3593 | | return new WP_Error( 'comment_save_error', __( '<strong>Error</strong>: The comment could not be saved. Please try again later.' ), 500 ); |
| 3593 | return new WP_Error( 'comment_save_error', __( '<strong>Error:</strong> The comment could not be saved. Please try again later.' ), 500 ); |
3594 | 3594 | } |
3595 | 3595 | |
3596 | 3596 | return get_comment( $comment_id ); |
diff --git a/src/wp-includes/load.php b/src/wp-includes/load.php
index ffbc1d2290..69e017fc92 100644
a
|
b
|
function wp_set_wpdb_vars() { |
624 | 624 | wp_die( |
625 | 625 | sprintf( |
626 | 626 | /* translators: 1: $table_prefix, 2: wp-config.php */ |
627 | | __( '<strong>Error</strong>: %1$s in %2$s can only contain numbers, letters, and underscores.' ), |
| 627 | __( '<strong>Error:</strong> %1$s in %2$s can only contain numbers, letters, and underscores.' ), |
628 | 628 | '<code>$table_prefix</code>', |
629 | 629 | '<code>wp-config.php</code>' |
630 | 630 | ) |
diff --git a/src/wp-includes/ms-deprecated.php b/src/wp-includes/ms-deprecated.php
index 1897e0f77b..5933d3fea0 100644
a
|
b
|
function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { |
401 | 401 | |
402 | 402 | // Check if the domain has been used already. We should return an error message. |
403 | 403 | if ( domain_exists($domain, $path, $site_id) ) |
404 | | return __( '<strong>Error</strong>: Site URL you’ve entered is already taken.' ); |
| 404 | return __( '<strong>Error:</strong> Site URL you’ve entered is already taken.' ); |
405 | 405 | |
406 | 406 | /* |
407 | 407 | * Need to back up wpdb table names, and create a new wp_blogs entry for new blog. |
… |
… |
function create_empty_blog( $domain, $path, $weblog_title, $site_id = 1 ) { |
410 | 410 | */ |
411 | 411 | |
412 | 412 | if ( ! $blog_id = insert_blog($domain, $path, $site_id) ) |
413 | | return __( '<strong>Error</strong>: There was a problem creating site entry.' ); |
| 413 | return __( '<strong>Error:</strong> There was a problem creating site entry.' ); |
414 | 414 | |
415 | 415 | switch_to_blog($blog_id); |
416 | 416 | install_blog($blog_id); |
diff --git a/src/wp-includes/pluggable.php b/src/wp-includes/pluggable.php
index 4a5891b8fd..d79e9520c9 100644
a
|
b
|
if ( ! function_exists( 'wp_authenticate' ) ) : |
595 | 595 | if ( null == $user ) { |
596 | 596 | // TODO: What should the error message be? (Or would these even happen?) |
597 | 597 | // Only needed if all authentication handlers fail to return anything. |
598 | | $user = new WP_Error( 'authentication_failed', __( '<strong>Error</strong>: Invalid username, email address or incorrect password.' ) ); |
| 598 | $user = new WP_Error( 'authentication_failed', __( '<strong>Error:</strong> Invalid username, email address or incorrect password.' ) ); |
599 | 599 | } |
600 | 600 | |
601 | 601 | $ignore_codes = array( 'empty_username', 'empty_password' ); |
diff --git a/src/wp-includes/user.php b/src/wp-includes/user.php
index 018c960c03..3c2431e6b4 100644
a
|
b
|
function wp_authenticate_username_password( $user, $username, $password ) { |
134 | 134 | $error = new WP_Error(); |
135 | 135 | |
136 | 136 | if ( empty( $username ) ) { |
137 | | $error->add( 'empty_username', __( '<strong>Error</strong>: The username field is empty.' ) ); |
| 137 | $error->add( 'empty_username', __( '<strong>Error:</strong> The username field is empty.' ) ); |
138 | 138 | } |
139 | 139 | |
140 | 140 | if ( empty( $password ) ) { |
141 | | $error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) ); |
| 141 | $error->add( 'empty_password', __( '<strong>Error:</strong> The password field is empty.' ) ); |
142 | 142 | } |
143 | 143 | |
144 | 144 | return $error; |
… |
… |
function wp_authenticate_username_password( $user, $username, $password ) { |
151 | 151 | 'invalid_username', |
152 | 152 | sprintf( |
153 | 153 | /* translators: %s: User name. */ |
154 | | __( '<strong>Error</strong>: The username <strong>%s</strong> is not registered on this site. If you are unsure of your username, try your email address instead.' ), |
| 154 | __( '<strong>Error:</strong> The username <strong>%s</strong> is not registered on this site. If you are unsure of your username, try your email address instead.' ), |
155 | 155 | $username |
156 | 156 | ) |
157 | 157 | ); |
… |
… |
function wp_authenticate_username_password( $user, $username, $password ) { |
176 | 176 | 'incorrect_password', |
177 | 177 | sprintf( |
178 | 178 | /* translators: %s: User name. */ |
179 | | __( '<strong>Error</strong>: The password you entered for the username %s is incorrect.' ), |
| 179 | __( '<strong>Error:</strong> The password you entered for the username %s is incorrect.' ), |
180 | 180 | '<strong>' . $username . '</strong>' |
181 | 181 | ) . |
182 | 182 | ' <a href="' . wp_lostpassword_url() . '">' . |
… |
… |
function wp_authenticate_email_password( $user, $email, $password ) { |
213 | 213 | |
214 | 214 | if ( empty( $email ) ) { |
215 | 215 | // Uses 'empty_username' for back-compat with wp_signon(). |
216 | | $error->add( 'empty_username', __( '<strong>Error</strong>: The email field is empty.' ) ); |
| 216 | $error->add( 'empty_username', __( '<strong>Error:</strong> The email field is empty.' ) ); |
217 | 217 | } |
218 | 218 | |
219 | 219 | if ( empty( $password ) ) { |
220 | | $error->add( 'empty_password', __( '<strong>Error</strong>: The password field is empty.' ) ); |
| 220 | $error->add( 'empty_password', __( '<strong>Error:</strong> The password field is empty.' ) ); |
221 | 221 | } |
222 | 222 | |
223 | 223 | return $error; |
… |
… |
function wp_authenticate_email_password( $user, $email, $password ) { |
248 | 248 | 'incorrect_password', |
249 | 249 | sprintf( |
250 | 250 | /* translators: %s: Email address. */ |
251 | | __( '<strong>Error</strong>: The password you entered for the email address %s is incorrect.' ), |
| 251 | __( '<strong>Error:</strong> The password you entered for the email address %s is incorrect.' ), |
252 | 252 | '<strong>' . $email . '</strong>' |
253 | 253 | ) . |
254 | 254 | ' <a href="' . wp_lostpassword_url() . '">' . |
… |
… |
function wp_authenticate_application_password( $input_user, $username, $password |
351 | 351 | if ( is_email( $username ) ) { |
352 | 352 | $error = new WP_Error( |
353 | 353 | 'invalid_email', |
354 | | __( '<strong>Error</strong>: Unknown email address. Check again or try your username.' ) |
| 354 | __( '<strong>Error:</strong> Unknown email address. Check again or try your username.' ) |
355 | 355 | ); |
356 | 356 | } else { |
357 | 357 | $error = new WP_Error( |
358 | 358 | 'invalid_username', |
359 | | __( '<strong>Error</strong>: Unknown username. Check again or try your email address.' ) |
| 359 | __( '<strong>Error:</strong> Unknown username. Check again or try your email address.' ) |
360 | 360 | ); |
361 | 361 | } |
362 | 362 | } elseif ( ! wp_is_application_passwords_available() ) { |
… |
… |
function wp_authenticate_spam_check( $user ) { |
503 | 503 | $spammed = apply_filters( 'check_is_user_spammed', is_user_spammy( $user ), $user ); |
504 | 504 | |
505 | 505 | if ( $spammed ) { |
506 | | return new WP_Error( 'spammer_account', __( '<strong>Error</strong>: Your account has been marked as a spammer.' ) ); |
| 506 | return new WP_Error( 'spammer_account', __( '<strong>Error:</strong> Your account has been marked as a spammer.' ) ); |
507 | 507 | } |
508 | 508 | } |
509 | 509 | return $user; |
… |
… |
function get_password_reset_key( $user ) { |
2561 | 2561 | global $wp_hasher; |
2562 | 2562 | |
2563 | 2563 | if ( ! ( $user instanceof WP_User ) ) { |
2564 | | return new WP_Error( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) ); |
| 2564 | return new WP_Error( 'invalidcombo', __( '<strong>Error:</strong> There is no account with that username or email address.' ) ); |
2565 | 2565 | } |
2566 | 2566 | |
2567 | 2567 | /** |
… |
… |
function retrieve_password( $user_login = null ) { |
2756 | 2756 | } |
2757 | 2757 | |
2758 | 2758 | if ( empty( $user_login ) ) { |
2759 | | $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username or email address.' ) ); |
| 2759 | $errors->add( 'empty_username', __( '<strong>Error:</strong> Please enter a username or email address.' ) ); |
2760 | 2760 | } elseif ( strpos( $user_login, '@' ) ) { |
2761 | 2761 | $user_data = get_user_by( 'email', trim( wp_unslash( $user_login ) ) ); |
2762 | 2762 | if ( empty( $user_data ) ) { |
2763 | | $errors->add( 'invalid_email', __( '<strong>Error</strong>: There is no account with that username or email address.' ) ); |
| 2763 | $errors->add( 'invalid_email', __( '<strong>Error:</strong> There is no account with that username or email address.' ) ); |
2764 | 2764 | } |
2765 | 2765 | } else { |
2766 | 2766 | $user_data = get_user_by( 'login', trim( wp_unslash( $user_login ) ) ); |
… |
… |
function retrieve_password( $user_login = null ) { |
2814 | 2814 | } |
2815 | 2815 | |
2816 | 2816 | if ( ! $user_data ) { |
2817 | | $errors->add( 'invalidcombo', __( '<strong>Error</strong>: There is no account with that username or email address.' ) ); |
| 2817 | $errors->add( 'invalidcombo', __( '<strong>Error:</strong> There is no account with that username or email address.' ) ); |
2818 | 2818 | return $errors; |
2819 | 2819 | } |
2820 | 2820 | |
… |
… |
function retrieve_password( $user_login = null ) { |
2901 | 2901 | 'retrieve_password_email_failure', |
2902 | 2902 | sprintf( |
2903 | 2903 | /* translators: %s: Documentation URL. */ |
2904 | | __( '<strong>Error</strong>: The email could not be sent. Your site may not be correctly configured to send emails. <a href="%s">Get support for resetting your password</a>.' ), |
| 2904 | __( '<strong>Error:</strong> The email could not be sent. Your site may not be correctly configured to send emails. <a href="%s">Get support for resetting your password</a>.' ), |
2905 | 2905 | esc_url( __( 'https://wordpress.org/support/article/resetting-your-password/' ) ) |
2906 | 2906 | ) |
2907 | 2907 | ); |
… |
… |
function register_new_user( $user_login, $user_email ) { |
2968 | 2968 | |
2969 | 2969 | // Check the username. |
2970 | 2970 | if ( '' === $sanitized_user_login ) { |
2971 | | $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) ); |
| 2971 | $errors->add( 'empty_username', __( '<strong>Error:</strong> Please enter a username.' ) ); |
2972 | 2972 | } elseif ( ! validate_username( $user_login ) ) { |
2973 | | $errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); |
| 2973 | $errors->add( 'invalid_username', __( '<strong>Error:</strong> This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); |
2974 | 2974 | $sanitized_user_login = ''; |
2975 | 2975 | } elseif ( username_exists( $sanitized_user_login ) ) { |
2976 | | $errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) ); |
| 2976 | $errors->add( 'username_exists', __( '<strong>Error:</strong> This username is already registered. Please choose another one.' ) ); |
2977 | 2977 | |
2978 | 2978 | } else { |
2979 | 2979 | /** This filter is documented in wp-includes/user.php */ |
2980 | 2980 | $illegal_user_logins = (array) apply_filters( 'illegal_user_logins', array() ); |
2981 | 2981 | if ( in_array( strtolower( $sanitized_user_login ), array_map( 'strtolower', $illegal_user_logins ), true ) ) { |
2982 | | $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) ); |
| 2982 | $errors->add( 'invalid_username', __( '<strong>Error:</strong> Sorry, that username is not allowed.' ) ); |
2983 | 2983 | } |
2984 | 2984 | } |
2985 | 2985 | |
2986 | 2986 | // Check the email address. |
2987 | 2987 | if ( '' === $user_email ) { |
2988 | | $errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your email address.' ) ); |
| 2988 | $errors->add( 'empty_email', __( '<strong>Error:</strong> Please type your email address.' ) ); |
2989 | 2989 | } elseif ( ! is_email( $user_email ) ) { |
2990 | | $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn’t correct.' ) ); |
| 2990 | $errors->add( 'invalid_email', __( '<strong>Error:</strong> The email address isn’t correct.' ) ); |
2991 | 2991 | $user_email = ''; |
2992 | 2992 | } elseif ( email_exists( $user_email ) ) { |
2993 | | $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered. Please choose another one.' ) ); |
| 2993 | $errors->add( 'email_exists', __( '<strong>Error:</strong> This email is already registered. Please choose another one.' ) ); |
2994 | 2994 | } |
2995 | 2995 | |
2996 | 2996 | /** |
… |
… |
function register_new_user( $user_login, $user_email ) { |
3035 | 3035 | 'registerfail', |
3036 | 3036 | sprintf( |
3037 | 3037 | /* translators: %s: Admin email address. */ |
3038 | | __( '<strong>Error</strong>: Couldn’t register you… please contact the <a href="mailto:%s">site admin</a>!' ), |
| 3038 | __( '<strong>Error:</strong> Couldn’t register you… please contact the <a href="mailto:%s">site admin</a>!' ), |
3039 | 3039 | get_option( 'admin_email' ) |
3040 | 3040 | ) |
3041 | 3041 | ); |
… |
… |
function send_confirmation_on_profile_email() { |
3271 | 3271 | if ( ! is_email( $_POST['email'] ) ) { |
3272 | 3272 | $errors->add( |
3273 | 3273 | 'user_email', |
3274 | | __( '<strong>Error</strong>: The email address isn’t correct.' ), |
| 3274 | __( '<strong>Error:</strong> The email address isn’t correct.' ), |
3275 | 3275 | array( |
3276 | 3276 | 'form-field' => 'email', |
3277 | 3277 | ) |
… |
… |
function send_confirmation_on_profile_email() { |
3283 | 3283 | if ( email_exists( $_POST['email'] ) ) { |
3284 | 3284 | $errors->add( |
3285 | 3285 | 'user_email', |
3286 | | __( '<strong>Error</strong>: The email address is already used.' ), |
| 3286 | __( '<strong>Error:</strong> The email address is already used.' ), |
3287 | 3287 | array( |
3288 | 3288 | 'form-field' => 'email', |
3289 | 3289 | ) |
diff --git a/src/wp-includes/wp-db.php b/src/wp-includes/wp-db.php
index 53ba207203..3d378f64db 100644
a
|
b
|
class wpdb { |
3636 | 3636 | // Make sure the server has the required MySQL version. |
3637 | 3637 | if ( version_compare( $this->db_version(), $required_mysql_version, '<' ) ) { |
3638 | 3638 | /* translators: 1: WordPress version number, 2: Minimum required MySQL version number. */ |
3639 | | return new WP_Error( 'database_version', sprintf( __( '<strong>Error</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) ); |
| 3639 | return new WP_Error( 'database_version', sprintf( __( '<strong>Error:</strong> WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ) ); |
3640 | 3640 | } |
3641 | 3641 | } |
3642 | 3642 | |
diff --git a/src/wp-login.php b/src/wp-login.php
index b7c14b4c83..4cb5ba1064 100644
a
|
b
|
switch ( $action ) { |
724 | 724 | |
725 | 725 | if ( isset( $_GET['error'] ) ) { |
726 | 726 | if ( 'invalidkey' === $_GET['error'] ) { |
727 | | $errors->add( 'invalidkey', __( '<strong>Error</strong>: Your password reset link appears to be invalid. Please request a new link below.' ) ); |
| 727 | $errors->add( 'invalidkey', __( '<strong>Error:</strong> Your password reset link appears to be invalid. Please request a new link below.' ) ); |
728 | 728 | } elseif ( 'expiredkey' === $_GET['error'] ) { |
729 | | $errors->add( 'expiredkey', __( '<strong>Error</strong>: Your password reset link has expired. Please request a new link below.' ) ); |
| 729 | $errors->add( 'expiredkey', __( '<strong>Error:</strong> Your password reset link has expired. Please request a new link below.' ) ); |
730 | 730 | } |
731 | 731 | } |
732 | 732 | |
… |
… |
switch ( $action ) { |
842 | 842 | $errors = new WP_Error(); |
843 | 843 | |
844 | 844 | if ( isset( $_POST['pass1'] ) && $_POST['pass1'] !== $_POST['pass2'] ) { |
845 | | $errors->add( 'password_reset_mismatch', __( '<strong>Error</strong>: The passwords do not match.' ) ); |
| 845 | $errors->add( 'password_reset_mismatch', __( '<strong>Error:</strong> The passwords do not match.' ) ); |
846 | 846 | } |
847 | 847 | |
848 | 848 | /** |
… |
… |
switch ( $action ) { |
1147 | 1147 | 'test_cookie', |
1148 | 1148 | sprintf( |
1149 | 1149 | /* translators: 1: Browser cookie documentation URL, 2: Support forums URL. */ |
1150 | | __( '<strong>Error</strong>: Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ), |
| 1150 | __( '<strong>Error:</strong> Cookies are blocked due to unexpected output. For help, please see <a href="%1$s">this documentation</a> or try the <a href="%2$s">support forums</a>.' ), |
1151 | 1151 | __( 'https://wordpress.org/support/article/cookies/' ), |
1152 | 1152 | __( 'https://wordpress.org/support/forums/' ) |
1153 | 1153 | ) |
… |
… |
switch ( $action ) { |
1158 | 1158 | 'test_cookie', |
1159 | 1159 | sprintf( |
1160 | 1160 | /* translators: %s: Browser cookie documentation URL. */ |
1161 | | __( '<strong>Error</strong>: Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ), |
| 1161 | __( '<strong>Error:</strong> Cookies are blocked or not supported by your browser. You must <a href="%s">enable cookies</a> to use WordPress.' ), |
1162 | 1162 | __( 'https://wordpress.org/support/article/cookies/#enable-cookies-in-your-browser' ) |
1163 | 1163 | ) |
1164 | 1164 | ); |
… |
… |
switch ( $action ) { |
1260 | 1260 | if ( isset( $_GET['loggedout'] ) && $_GET['loggedout'] ) { |
1261 | 1261 | $errors->add( 'loggedout', __( 'You are now logged out.' ), 'message' ); |
1262 | 1262 | } elseif ( isset( $_GET['registration'] ) && 'disabled' === $_GET['registration'] ) { |
1263 | | $errors->add( 'registerdisabled', __( '<strong>Error</strong>: User registration is currently not allowed.' ) ); |
| 1263 | $errors->add( 'registerdisabled', __( '<strong>Error:</strong> User registration is currently not allowed.' ) ); |
1264 | 1264 | } elseif ( strpos( $redirect_to, 'about.php?updated' ) ) { |
1265 | 1265 | $errors->add( 'updated', __( '<strong>You have successfully updated WordPress!</strong> Please log back in to see what’s new.' ), 'message' ); |
1266 | 1266 | } elseif ( WP_Recovery_Mode_Link_Service::LOGIN_ACTION_ENTERED === $action ) { |