Changeset 53458 for trunk/src/wp-admin/includes/user.php
- Timestamp:
- 06/02/2022 03:03:39 PM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/user.php
r53455 r53458 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 … … 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 do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );177 $errors->add( 'pass', __( '<strong>Error:</strong> Passwords do not match. Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) ); 178 178 } 179 179 … … 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 … … 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 is not correct.' ), array( 'form-field' => 'email' ) );203 $errors->add( 'invalid_email', __( '<strong>Error:</strong> The email address is not 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 }
Note: See TracChangeset
for help on using the changeset viewer.