Changeset 47156 for trunk/src/wp-admin/includes/user.php
- Timestamp:
- 02/01/2020 09:36:44 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-admin/includes/user.php
r47122 r47156 145 145 /* checking that username has been typed */ 146 146 if ( $user->user_login == '' ) { 147 $errors->add( 'user_login', __( '<strong>E RROR</strong>: Please enter a username.' ) );147 $errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' ) ); 148 148 } 149 149 150 150 /* checking that nickname has been typed */ 151 151 if ( $update && empty( $user->nickname ) ) { 152 $errors->add( 'nickname', __( '<strong>E RROR</strong>: Please enter a nickname.' ) );152 $errors->add( 'nickname', __( '<strong>Error</strong>: Please enter a nickname.' ) ); 153 153 } 154 154 … … 166 166 // Check for blank password when adding a user. 167 167 if ( ! $update && empty( $pass1 ) ) { 168 $errors->add( 'pass', __( '<strong>E RROR</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) );168 $errors->add( 'pass', __( '<strong>Error</strong>: Please enter a password.' ), array( 'form-field' => 'pass1' ) ); 169 169 } 170 170 171 171 // Check for "\" in password. 172 172 if ( false !== strpos( wp_unslash( $pass1 ), '\\' ) ) { 173 $errors->add( 'pass', __( '<strong>E RROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );173 $errors->add( 'pass', __( '<strong>Error</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) ); 174 174 } 175 175 176 176 // Checking the password has been typed twice the same. 177 177 if ( ( $update || ! empty( $pass1 ) ) && $pass1 != $pass2 ) { 178 $errors->add( 'pass', __( '<strong>E RROR</strong>: Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) );178 $errors->add( 'pass', __( '<strong>Error</strong>: Please enter the same password in both password fields.' ), array( 'form-field' => 'pass1' ) ); 179 179 } 180 180 … … 184 184 185 185 if ( ! $update && isset( $_POST['user_login'] ) && ! validate_username( $_POST['user_login'] ) ) { 186 $errors->add( 'user_login', __( '<strong>E RROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );186 $errors->add( 'user_login', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); 187 187 } 188 188 189 189 if ( ! $update && username_exists( $user->user_login ) ) { 190 $errors->add( 'user_login', __( '<strong>E RROR</strong>: This username is already registered. Please choose another one.' ) );190 $errors->add( 'user_login', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' ) ); 191 191 } 192 192 … … 195 195 196 196 if ( in_array( strtolower( $user->user_login ), array_map( 'strtolower', $illegal_logins ), true ) ) { 197 $errors->add( 'invalid_username', __( '<strong>E RROR</strong>: Sorry, that username is not allowed.' ) );197 $errors->add( 'invalid_username', __( '<strong>Error</strong>: Sorry, that username is not allowed.' ) ); 198 198 } 199 199 200 200 /* checking email address */ 201 201 if ( empty( $user->user_email ) ) { 202 $errors->add( 'empty_email', __( '<strong>E RROR</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) );202 $errors->add( 'empty_email', __( '<strong>Error</strong>: Please enter an email address.' ), array( 'form-field' => 'email' ) ); 203 203 } elseif ( ! is_email( $user->user_email ) ) { 204 $errors->add( 'invalid_email', __( '<strong>E RROR</strong>: The email address isn’t correct.' ), array( 'form-field' => 'email' ) );204 $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn’t correct.' ), array( 'form-field' => 'email' ) ); 205 205 } else { 206 206 $owner_id = email_exists( $user->user_email ); 207 207 if ( $owner_id && ( ! $update || ( $owner_id != $user->ID ) ) ) { 208 $errors->add( 'email_exists', __( '<strong>E RROR</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) );208 $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered, please choose another one.' ), array( 'form-field' => 'email' ) ); 209 209 } 210 210 }
Note: See TracChangeset
for help on using the changeset viewer.