mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-02-24 01:32:47 +00:00
Strip HTML tags when searching for installed themes.
props enej, SergeyBiryukov, obenland. fixes #27561. git-svn-id: https://develop.svn.wordpress.org/trunk@31240 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
a036114a4d
commit
4a1cf7a38b
@ -165,7 +165,7 @@ themes.Collection = Backbone.Collection.extend({
|
||||
// Performs a search within the collection
|
||||
// @uses RegExp
|
||||
search: function( term ) {
|
||||
var match, results, haystack;
|
||||
var match, results, haystack, name, description, author;
|
||||
|
||||
// Start with a full collection
|
||||
this.reset( themes.data.themes, { silent: true } );
|
||||
@ -181,7 +181,11 @@ themes.Collection = Backbone.Collection.extend({
|
||||
// Find results
|
||||
// _.filter and .test
|
||||
results = this.filter( function( data ) {
|
||||
haystack = _.union( data.get( 'name' ), data.get( 'id' ), data.get( 'description' ), data.get( 'author' ), data.get( 'tags' ) );
|
||||
name = data.get( 'name' ).replace( /(<([^>]+)>)/ig, '' );
|
||||
description = data.get( 'description' ).replace( /(<([^>]+)>)/ig, '' );
|
||||
author = data.get( 'author' ).replace( /(<([^>]+)>)/ig, '' );
|
||||
|
||||
haystack = _.union( name, data.get( 'id' ), description, author, data.get( 'tags' ) );
|
||||
|
||||
if ( match.test( data.get( 'author' ) ) && term.length > 2 ) {
|
||||
data.set( 'displayAuthor', true );
|
||||
|
||||
Loading…
Reference in New Issue
Block a user