Ticket #26474: wp-login.diff
File wp-login.diff, 3.6 KB (added by , 8 years ago) |
---|
-
wp-login.php
22 22 } 23 23 } 24 24 25 26 /** 27 * Create Password Input Attributes 28 * 29 * @param array $attributes Required. Returns attributes for password fields. 30 */ 31 function password_input_attributes( $attributes ) { 32 33 // Set up an array of defaults for password fields 34 $password_input_attributes = array( 35 'name' => '', 36 'id' => '', 37 'class' => 'input', 38 'value' => '', 39 'size' => '20', 40 'autocomplete' => 'off', 41 ); 42 43 // Merge the attributes for a specific password field 44 $password_input_attributes = array_merge( $password_input_attributes, $attributes ); 45 46 // Allow filtering of the attributes array 47 if ( has_filter( 'wp_password_input_attributes' ) ) { 48 49 $password_input_attributes = apply_filters( 'wp_password_input_attributes', $password_input_attributes ); 50 51 } 52 53 $html = " "; 54 55 // Create a sanitized string of attributes and values 56 foreach( $password_input_attributes as $attribute_name => $attribute_value ) { 57 $html .= sanitize_key( $attribute_name ) . '="' . esc_attr( $attribute_value ) . '" '; 58 } 59 60 return $html; 61 } 62 25 63 /** 26 64 * Output the login page header. 27 65 * … … 358 396 359 397 /** 360 398 * Filters the message body of the password reset mail. 361 * 399 * 362 400 * If the filtered message is empty, the password reset email will not be sent. 363 401 * 364 402 * @since 2.8.0 … … 438 476 exit(); 439 477 } 440 478 441 require_once ABSPATH . WPINC . '/class-phpass.php';442 479 $hasher = new PasswordHash( 8, true ); 443 480 444 481 /** … … 634 671 635 672 <div class="wp-pwd"> 636 673 <span class="password-input-wrapper"> 637 <input type="password" data-reveal="1" data-pw="<?php echo esc_attr( wp_generate_password( 16 ) ); ?>" name="pass1" id="pass1" class="input" size="20" value="" autocomplete="off" aria-describedby="pass-strength-result" /> 674 <?php $data_pw = esc_attr( wp_generate_password( 16 ) ) ?> 675 <input type="password" <?php echo password_input_attributes( array( 'name' => 'pass1', 'id' => 'pass1', 'aria-describedby' => 'pass-strength-result', 'data-reveal' => 1, 'data-pw' => $data_pw ) ); ?> /> 638 676 </span> 639 677 <div id="pass-strength-result" class="hide-if-no-js" aria-live="polite"><?php _e( 'Strength indicator' ); ?></div> 640 678 </div> … … 642 680 643 681 <p class="user-pass2-wrap"> 644 682 <label for="pass2"><?php _e( 'Confirm new password' ) ?></label><br /> 645 <input type="password" name="pass2" id="pass2" class="input" size="20" value="" autocomplete="off"/>683 <input type="password" <?php echo password_input_attributes( array( 'name' => 'pass2', 'id' => 'pass2' ) ); ?> /> 646 684 </p> 647 685 648 686 <p class="description indicator-hint"><?php echo wp_get_password_hint(); ?></p> … … 904 942 </p> 905 943 <p> 906 944 <label for="user_pass"><?php _e( 'Password' ); ?><br /> 907 <input type="password" name="pwd" id="user_pass"<?php echo $aria_describedby_error; ?> class="input" value="" size="20" /></label>945 <input type="password"<?php echo $aria_describedby_error; ?> <?php echo password_input_attributes( array( 'name' => 'pwd', 'id' => 'user_pass' ) ); ?> /> 908 946 </p> 909 947 <?php 910 948 /** … … 964 1002 }, 200); 965 1003 } 966 1004 967 /** 968 * Filters whether to print the call to `wp_attempt_focus()` on the login screen. 969 * 970 * @since 4.8.0 971 * 972 * @param bool $print Whether to print the function call. Default true. 973 */ 974 <?php if ( apply_filters( 'enable_login_autofocus', true ) && ! $error ) { ?> 1005 <?php if ( !$error ) { ?> 975 1006 wp_attempt_focus(); 976 1007 <?php } ?> 977 1008 if(typeof wpOnload=='function')wpOnload();