Making WordPress.org

Changeset 7890


Ignore:
Timestamp:
11/23/2018 06:25:31 AM (6 years ago)
Author:
dd32
Message:

Trac: Block uploading of ZIPs to themes.trac.wordpress.org and display a notice directing them to the Theme upload form.

This can be bypassed, but is a much simpler solution than modifying Trac.

Fixes #3904.

File:
1 edited

Legend:

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

    r7497 r7890  
    196196                $( '#h_reporter' ).text( 'Developer:' );
    197197                $( '#h_owner' ).text( 'Reviewer:' );
     198
     199                // Prevent uploading of ZIP files to Trac.
     200                // See https://meta.trac.wordpress.org/ticket/3904
     201                $( '#attachment input[type="file"]' ).change( function() {
     202                    var ext = this.value.split('.').pop();
     203                    $( '#wp-block-zip-upload' ).remove(); // Hide the notice if it's already in the DOM
     204                    if ( 'zip' == ext ) {
     205                        this.value = '';
     206
     207                        $(this).parents('div.field').after( '<div class="wp-notice" id="wp-block-zip-upload"><p><strong>Please do not upload ZIPs to Trac.</strong><br>All Theme ZIPs (including updates) should be submitted via <a href="https://wordpress.org/themes/upload/">https://wordpress.org/themes/upload/</a>.</p></div>' );
     208                    }
     209                } );
    198210            }
    199211
Note: See TracChangeset for help on using the changeset viewer.