diff --git a/src/js/_enqueues/wp/theme.js b/src/js/_enqueues/wp/theme.js index 596b097f59..74a90cc609 100644 --- a/src/js/_enqueues/wp/theme.js +++ b/src/js/_enqueues/wp/theme.js @@ -180,6 +180,9 @@ themes.Collection = Backbone.Collection.extend({ // Start with a full collection this.reset( themes.data.themes, { silent: true } ); + // Trim the term + term = term.trim(); + // Escape the term string for RegExp meta characters term = term.replace( /[-\/\\^$*+?.()|[\]{}]/g, '\\$&' );