Make WordPress Core

Ticket #33699: 33699.diff

File 33699.diff, 1.2 KB (added by adamsilverstein, 9 years ago)
  • src/wp-admin/js/user-profile.js

     
    195195                        }
    196196                } );
    197197
     198                // Disable the hidden inputs to prevent autofill and submission.
     199                $pass1.prop( 'disabled', true );
     200                $pass2.prop( 'disabled', true );
     201                $pass1Text.prop( 'disabled', true )
     202
    198203                $passwordWrapper = $pass1Row.find( '.wp-pwd' );
    199204                $generateButton  = $pass1Row.find( 'button.wp-generate-pw' );
    200205
     
    211216                        $generateButton.hide();
    212217                        $passwordWrapper.show();
    213218
     219                        // Enable the inputs when showing.
     220                        $pass1.attr( 'disabled', false );
     221                        $pass2.attr( 'disabled', false );
     222                        $pass1Text.attr( 'disabled', false )
     223
    214224                        if ( $pass1Text.val().length === 0 ) {
    215225                                generatePassword();
    216226                        }
     
    239249                        $generateButton.show();
    240250                        $passwordWrapper.hide();
    241251
     252                        // Disable the inputs when hiding to prevent autofill and submission.
     253                        $pass1.prop( 'disabled', true );
     254                        $pass2.prop( 'disabled', true );
     255                        $pass1Text.prop( 'disabled', true )
     256
    242257                        resetToggle();
    243258
    244259                        // Clear password field to prevent update