Make WordPress Core

Ticket #27561: 27561.diff

File 27561.diff, 1.1 KB (added by obenland, 10 years ago)
  • src/wp-admin/js/theme.js

     
    165165        // Performs a search within the collection
    166166        // @uses RegExp
    167167        search: function( term ) {
    168                 var match, results, haystack;
     168                var match, results, haystack, name, description, author;
    169169
    170170                // Start with a full collection
    171171                this.reset( themes.data.themes, { silent: true } );
     
    181181                // Find results
    182182                // _.filter and .test
    183183                results = this.filter( function( data ) {
    184                         haystack = _.union( data.get( 'name' ), data.get( 'id' ), data.get( 'description' ), data.get( 'author' ), data.get( 'tags' ) );
     184                        name        = data.get( 'name' ).replace( /(<([^>]+)>)/ig, '' );
     185                        description = data.get( 'description' ).replace( /(<([^>]+)>)/ig, '' );
     186                        author      = data.get( 'author' ).replace( /(<([^>]+)>)/ig, '' );
     187
     188                        haystack = _.union( name, data.get( 'id' ), description, author, data.get( 'tags' ) );
    185189
    186190                        if ( match.test( data.get( 'author' ) ) && term.length > 2 ) {
    187191                                data.set( 'displayAuthor', true );