Ticket #15887: 15887.patch
File 15887.patch, 17.4 KB (added by , 14 years ago) |
---|
-
wp-admin/import.php
53 53 <?php screen_icon(); ?> 54 54 <h2><?php echo esc_html( $title ); ?></h2> 55 55 <?php if ( ! empty( $_GET['invalid'] ) ) : ?> 56 <div class="error"><p><strong><?php _e('E RROR:')?></strong> <?php printf( __('The <strong>%s</strong> importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?></p></div>56 <div class="error"><p><strong><?php _e('Error:')?></strong> <?php printf( __('The <strong>%s</strong> importer is invalid or is not installed.'), esc_html( $_GET['invalid'] ) ); ?></p></div> 57 57 <?php endif; ?> 58 58 <p><?php _e('If you have posts or comments in another system, WordPress can import those into this site. To get started, choose a system to import from below:'); ?></p> 59 59 -
wp-admin/includes/ms.php
255 255 256 256 if ( $current_user->user_email != $_POST['email'] ) { 257 257 if ( !is_email( $_POST['email'] ) ) { 258 $errors->add( 'user_email', __( "<strong>E RROR</strong>: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) );258 $errors->add( 'user_email', __( "<strong>Error</strong>: The e-mail address isn't correct." ), array( 'form-field' => 'email' ) ); 259 259 return; 260 260 } 261 261 262 262 if ( $wpdb->get_var( $wpdb->prepare( "SELECT user_email FROM {$wpdb->users} WHERE user_email=%s", $_POST['email'] ) ) ) { 263 $errors->add( 'user_email', __( "<strong>E RROR</strong>: The e-mail address is already used." ), array( 'form-field' => 'email' ) );263 $errors->add( 'user_email', __( "<strong>Error</strong>: The e-mail address is already used." ), array( 'form-field' => 'email' ) ); 264 264 delete_option( $current_user->ID . '_new_email' ); 265 265 return; 266 266 } -
wp-admin/includes/user.php
132 132 133 133 /* checking that username has been typed */ 134 134 if ( $user->user_login == '' ) 135 $errors->add( 'user_login', __( '<strong>E RROR</strong>: Please enter a username.' ));135 $errors->add( 'user_login', __( '<strong>Error</strong>: Please enter a username.' )); 136 136 137 137 /* checking the password has been typed twice */ 138 138 do_action_ref_array( 'check_passwords', array ( $user->user_login, & $pass1, & $pass2 )); 139 139 140 140 if ( $update ) { 141 141 if ( empty($pass1) && !empty($pass2) ) 142 $errors->add( 'pass', __( '<strong>E RROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) );142 $errors->add( 'pass', __( '<strong>Error</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass1' ) ); 143 143 elseif ( !empty($pass1) && empty($pass2) ) 144 $errors->add( 'pass', __( '<strong>E RROR</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) );144 $errors->add( 'pass', __( '<strong>Error</strong>: You entered your new password only once.' ), array( 'form-field' => 'pass2' ) ); 145 145 } else { 146 146 if ( empty($pass1) ) 147 $errors->add( 'pass', __( '<strong>E RROR</strong>: Please enter your password.' ), array( 'form-field' => 'pass1' ) );147 $errors->add( 'pass', __( '<strong>Error</strong>: Please enter your password.' ), array( 'form-field' => 'pass1' ) ); 148 148 elseif ( empty($pass2) ) 149 $errors->add( 'pass', __( '<strong>E RROR</strong>: Please enter your password twice.' ), array( 'form-field' => 'pass2' ) );149 $errors->add( 'pass', __( '<strong>Error</strong>: Please enter your password twice.' ), array( 'form-field' => 'pass2' ) ); 150 150 } 151 151 152 152 /* Check for "\" in password */ 153 153 if ( false !== strpos( stripslashes($pass1), "\\" ) ) 154 $errors->add( 'pass', __( '<strong>E RROR</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) );154 $errors->add( 'pass', __( '<strong>Error</strong>: Passwords may not contain the character "\\".' ), array( 'form-field' => 'pass1' ) ); 155 155 156 156 /* checking the password has been typed twice the same */ 157 157 if ( $pass1 != $pass2 ) 158 $errors->add( 'pass', __( '<strong>E RROR</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) );158 $errors->add( 'pass', __( '<strong>Error</strong>: Please enter the same password in the two password fields.' ), array( 'form-field' => 'pass1' ) ); 159 159 160 160 if ( !empty( $pass1 ) ) 161 161 $user->user_pass = $pass1; 162 162 163 163 if ( !$update && isset( $_POST['user_login'] ) && !validate_username( $_POST['user_login'] ) ) 164 $errors->add( 'user_login', __( '<strong>E RROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ));164 $errors->add( 'user_login', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' )); 165 165 166 166 if ( !$update && username_exists( $user->user_login ) ) 167 $errors->add( 'user_login', __( '<strong>E RROR</strong>: This username is already registered. Please choose another one.' ));167 $errors->add( 'user_login', __( '<strong>Error</strong>: This username is already registered. Please choose another one.' )); 168 168 169 169 /* checking e-mail address */ 170 170 if ( empty( $user->user_email ) ) { 171 $errors->add( 'empty_email', __( '<strong>E RROR</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) );171 $errors->add( 'empty_email', __( '<strong>Error</strong>: Please enter an e-mail address.' ), array( 'form-field' => 'email' ) ); 172 172 } elseif ( !is_email( $user->user_email ) ) { 173 $errors->add( 'invalid_email', __( '<strong>E RROR</strong>: The e-mail address isn’t correct.' ), array( 'form-field' => 'email' ) );173 $errors->add( 'invalid_email', __( '<strong>Error</strong>: The e-mail address isn’t correct.' ), array( 'form-field' => 'email' ) ); 174 174 } elseif ( ( $owner_id = email_exists($user->user_email) ) && ( !$update || ( $owner_id != $user->ID ) ) ) { 175 $errors->add( 'email_exists', __('<strong>E RROR</strong>: This email is already registered, please choose another one.'), array( 'form-field' => 'email' ) );175 $errors->add( 'email_exists', __('<strong>Error</strong>: This email is already registered, please choose another one.'), array( 'form-field' => 'email' ) ); 176 176 } 177 177 178 178 // Allow plugins to return their own errors. -
wp-admin/install.php
89 89 90 90 if ( ! is_null( $error ) ) { 91 91 ?> 92 <p class="message"><?php printf( __( '<strong>E RROR</strong>: %s' ), $error ); ?></p>92 <p class="message"><?php printf( __( '<strong>Error</strong>: %s' ), $error ); ?></p> 93 93 <?php } ?> 94 94 <form id="setup" method="post" action="install.php?step=2"> 95 95 <table class="form-table"> -
wp-admin/network.php
173 173 174 174 $error_codes = array(); 175 175 if ( is_wp_error( $errors ) ) { 176 echo '<div class="error"><p><strong>' . __( 'E RROR: The network could not be created.' ) . '</strong></p>';176 echo '<div class="error"><p><strong>' . __( 'Error: The network could not be created.' ) . '</strong></p>'; 177 177 foreach ( $errors->get_error_messages() as $error ) 178 178 echo "<p>$error</p>"; 179 179 echo '</div>'; -
wp-admin/setup-config.php
162 162 163 163 // Validate $prefix: it can only contain letters, numbers and underscores 164 164 if ( preg_match( '|[^a-z0-9_]|i', $prefix ) ) 165 wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>E RROR</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ );165 wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>Error</strong>: "Table Prefix" can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ ); 166 166 167 167 // Test the db connection. 168 168 /**#@+ -
wp-includes/functions.php
1737 1737 1738 1738 $hook = 'do_feed_' . $feed; 1739 1739 if ( !has_action($hook) ) { 1740 $message = sprintf( __( 'E RROR: %s is not a valid feed template.' ), esc_html($feed));1740 $message = sprintf( __( 'Error: %s is not a valid feed template.' ), esc_html($feed)); 1741 1741 wp_die( $message, '', array( 'response' => 404 ) ); 1742 1742 } 1743 1743 -
wp-includes/load.php
362 362 $prefix = $wpdb->set_prefix( $table_prefix ); 363 363 364 364 if ( is_wp_error( $prefix ) ) 365 wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>E RROR</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ );365 wp_die( /*WP_I18N_BAD_PREFIX*/'<strong>Error</strong>: <code>$table_prefix</code> in <code>wp-config.php</code> can only contain numbers, letters, and underscores.'/*/WP_I18N_BAD_PREFIX*/ ); 366 366 } 367 367 368 368 /** -
wp-includes/pluggable.php
487 487 if ( $user == null ) { 488 488 // TODO what should the error message be? (Or would these even happen?) 489 489 // Only needed if all authentication handlers fail to return anything. 490 $user = new WP_Error('authentication_failed', __('<strong>E RROR</strong>: Invalid username or incorrect password.'));490 $user = new WP_Error('authentication_failed', __('<strong>Error</strong>: Invalid username or incorrect password.')); 491 491 } 492 492 493 493 $ignore_codes = array('empty_username', 'empty_password'); -
wp-includes/user.php
77 77 $error = new WP_Error(); 78 78 79 79 if ( empty($username) ) 80 $error->add('empty_username', __('<strong>E RROR</strong>: The username field is empty.'));80 $error->add('empty_username', __('<strong>Error</strong>: The username field is empty.')); 81 81 82 82 if ( empty($password) ) 83 $error->add('empty_password', __('<strong>E RROR</strong>: The password field is empty.'));83 $error->add('empty_password', __('<strong>Error</strong>: The password field is empty.')); 84 84 85 85 return $error; 86 86 } … … 88 88 $userdata = get_user_by('login', $username); 89 89 90 90 if ( !$userdata ) 91 return new WP_Error('invalid_username', sprintf(__('<strong>E RROR</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login')));91 return new WP_Error('invalid_username', sprintf(__('<strong>Error</strong>: Invalid username. <a href="%s" title="Password Lost and Found">Lost your password</a>?'), site_url('wp-login.php?action=lostpassword', 'login'))); 92 92 93 93 if ( is_multisite() ) { 94 94 // Is user marked as spam? 95 95 if ( 1 == $userdata->spam) 96 return new WP_Error('invalid_username', __('<strong>E RROR</strong>: Your account has been marked as a spammer.'));96 return new WP_Error('invalid_username', __('<strong>Error</strong>: Your account has been marked as a spammer.')); 97 97 98 98 // Is a user's blog marked as spam? 99 99 if ( !is_super_admin( $userdata->ID ) && isset($userdata->primary_blog) ) { … … 108 108 return $userdata; 109 109 110 110 if ( !wp_check_password($password, $userdata->user_pass, $userdata->ID) ) 111 return new WP_Error( 'incorrect_password', sprintf( __( '<strong>E RROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ),111 return new WP_Error( 'incorrect_password', sprintf( __( '<strong>Error</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s" title="Password Lost and Found">Lost your password</a>?' ), 112 112 $username, site_url( 'wp-login.php?action=lostpassword', 'login' ) ) ); 113 113 114 114 $user = new WP_User($userdata->ID); -
wp-includes/wp-db.php
1498 1498 global $wp_version, $required_mysql_version; 1499 1499 // Make sure the server has the required MySQL version 1500 1500 if ( version_compare($this->db_version(), $required_mysql_version, '<') ) 1501 return new WP_Error('database_version', sprintf( __( '<strong>E RROR</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version ));1501 return new WP_Error('database_version', sprintf( __( '<strong>Error</strong>: WordPress %1$s requires MySQL %2$s or higher' ), $wp_version, $required_mysql_version )); 1502 1502 } 1503 1503 1504 1504 /** -
wp-login.php
168 168 $errors = new WP_Error(); 169 169 170 170 if ( empty( $_POST['user_login'] ) && empty( $_POST['user_email'] ) ) 171 $errors->add('empty_username', __('<strong>E RROR</strong>: Enter a username or e-mail address.'));171 $errors->add('empty_username', __('<strong>Error</strong>: Enter a username or e-mail address.')); 172 172 173 173 if ( strpos($_POST['user_login'], '@') ) { 174 174 $user_data = get_user_by_email(trim($_POST['user_login'])); 175 175 if ( empty($user_data) ) 176 $errors->add('invalid_email', __('<strong>E RROR</strong>: There is no user registered with that email address.'));176 $errors->add('invalid_email', __('<strong>Error</strong>: There is no user registered with that email address.')); 177 177 } else { 178 178 $login = trim($_POST['user_login']); 179 179 $user_data = get_userdatabylogin($login); … … 185 185 return $errors; 186 186 187 187 if ( !$user_data ) { 188 $errors->add('invalidcombo', __('<strong>E RROR</strong>: Invalid username or e-mail.'));188 $errors->add('invalidcombo', __('<strong>Error</strong>: Invalid username or e-mail.')); 189 189 return $errors; 190 190 } 191 191 … … 295 295 296 296 // Check the username 297 297 if ( $sanitized_user_login == '' ) { 298 $errors->add( 'empty_username', __( '<strong>E RROR</strong>: Please enter a username.' ) );298 $errors->add( 'empty_username', __( '<strong>Error</strong>: Please enter a username.' ) ); 299 299 } elseif ( ! validate_username( $user_login ) ) { 300 $errors->add( 'invalid_username', __( '<strong>E RROR</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) );300 $errors->add( 'invalid_username', __( '<strong>Error</strong>: This username is invalid because it uses illegal characters. Please enter a valid username.' ) ); 301 301 $sanitized_user_login = ''; 302 302 } elseif ( username_exists( $sanitized_user_login ) ) { 303 $errors->add( 'username_exists', __( '<strong>E RROR</strong>: This username is already registered, please choose another one.' ) );303 $errors->add( 'username_exists', __( '<strong>Error</strong>: This username is already registered, please choose another one.' ) ); 304 304 } 305 305 306 306 // Check the e-mail address 307 307 if ( $user_email == '' ) { 308 $errors->add( 'empty_email', __( '<strong>E RROR</strong>: Please type your e-mail address.' ) );308 $errors->add( 'empty_email', __( '<strong>Error</strong>: Please type your e-mail address.' ) ); 309 309 } elseif ( ! is_email( $user_email ) ) { 310 $errors->add( 'invalid_email', __( '<strong>E RROR</strong>: The email address isn’t correct.' ) );310 $errors->add( 'invalid_email', __( '<strong>Error</strong>: The email address isn’t correct.' ) ); 311 311 $user_email = ''; 312 312 } elseif ( email_exists( $user_email ) ) { 313 $errors->add( 'email_exists', __( '<strong>E RROR</strong>: This email is already registered, please choose another one.' ) );313 $errors->add( 'email_exists', __( '<strong>Error</strong>: This email is already registered, please choose another one.' ) ); 314 314 } 315 315 316 316 do_action( 'register_post', $sanitized_user_login, $user_email, $errors ); … … 323 323 $user_pass = wp_generate_password( 12, false); 324 324 $user_id = wp_create_user( $sanitized_user_login, $user_pass, $user_email ); 325 325 if ( ! $user_id ) { 326 $errors->add( 'registerfail', sprintf( __( '<strong>E RROR</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) );326 $errors->add( 'registerfail', sprintf( __( '<strong>Error</strong>: Couldn’t register you... please contact the <a href="mailto:%s">webmaster</a> !' ), get_option( 'admin_email' ) ) ); 327 327 return $errors; 328 328 } 329 329 … … 601 601 602 602 // If cookies are disabled we can't log in even with a valid user+pass 603 603 if ( isset($_POST['testcookie']) && empty($_COOKIE[TEST_COOKIE]) ) 604 $errors->add('test_cookie', __("<strong>E RROR</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress."));604 $errors->add('test_cookie', __("<strong>Error</strong>: Cookies are blocked or not supported by your browser. You must <a href='http://www.google.com/cookies.html'>enable cookies</a> to use WordPress.")); 605 605 606 606 // Some parts of this script use the main login form to display a message 607 607 if ( isset($_GET['loggedout']) && TRUE == $_GET['loggedout'] )