Make WordPress Core

Ticket #27136: 27136.diff

File 27136.diff, 899 bytes (added by SergeyBiryukov, 11 years ago)

Minor cleanup

  • src/wp-admin/js/theme.js

     
    189189                // Find results
    190190                // _.filter and .test
    191191                results = this.filter( function( data ) {
    192                         haystack = _.union( data.get( 'name' ), data.get( 'id' ), data.get( 'description' ), data.get( 'author' ), data.get( 'tags' ) );
     192                        var name, description, author;
    193193
     194                        name        = data.get( 'name' ).replace( /(<([^>]+)>)/ig, '' );
     195                        description = data.get( 'description' ).replace( /(<([^>]+)>)/ig, '' );
     196                        author      = data.get( 'author' ).replace( /(<([^>]+)>)/ig, '' );
     197
     198                        haystack = _.union( name, data.get( 'id' ), description, author, data.get( 'tags' ) );
     199
    194200                        if ( match.test( data.get( 'author' ) ) && term.length > 2 ) {
    195201                                data.set( 'displayAuthor', true );
    196202                        }