Making WordPress.org

Changeset 3143


Ignore:
Timestamp:
05/14/2016 12:57:54 PM (8 years ago)
Author:
ocean90
Message:

Trac: Disable submit only if the security question isn't already checked.

Props jorbin.
Fixes #851.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • sites/trunk/wordpress.org/public_html/style/trac/trac-security.js

    r3135 r3143  
    1717            'escape', 'unescape', 'escaped', 'unescaped', 'escapes', 'escaping', 'unescaping', 'esc_',
    1818            'sanitize', 'unsanitize', 'sanitizes', 'unsanitizes', 'sanitized', 'unsanitized', 'sanitization',
    19             'valid', 'invalid', 'validate', 'validates', 'validation','hack', 'vulnerable', 'attack', 
    20             'compromise', 'escalation', 'injection', 'forgery', 'password', 'passwords', 'cross-site' , 
    21             'secure' 
     19            'valid', 'invalid', 'validate', 'validates', 'validation','hack', 'vulnerable', 'attack',
     20            'compromise', 'escalation', 'injection', 'forgery', 'password', 'passwords', 'cross-site' ,
     21            'secure'
    2222        ],
    2323
     
    3737
    3838    function show_box() {
    39         // We have a potential problem here
    40         submit.prop( 'disabled', true );
     39        // Disable submit only if the box isn't already checked.
     40        if ( false === $( '#security-question input' ).is( ':checked' ) ) {
     41            submit.prop( 'disabled', true );
     42        }
     43
    4144        if ( $( '#security-question' ).length !== 0 ) {
    4245            // We've already created the checkbox
     
    5861    jQuery( '#field-summary, #field-description, #field-keywords' ).on( 'keyup', function() {
    5962        var entry = $(this).val();
    60        
     63
    6164        if ( wp.trac_security.has_overlap( entry, wp.trac_security.badwords ) ) {
    6265            show_box();
Note: See TracChangeset for help on using the changeset viewer.