diff --git a/app/assets/javascripts/discourse/components/search-advanced-options.js.es6 b/app/assets/javascripts/discourse/components/search-advanced-options.js.es6 index ba68acd8bb6..51ec9b4483b 100644 --- a/app/assets/javascripts/discourse/components/search-advanced-options.js.es6 +++ b/app/assets/javascripts/discourse/components/search-advanced-options.js.es6 @@ -1,4 +1,5 @@ import { observes } from 'ember-addons/ember-computed-decorators'; +import { escapeExpression } from 'discourse/lib/utilities'; const REGEXP_BLOCKS = /(([^" \t\n\x0B\f\r]+)?(("[^"]+")?))/g; @@ -103,7 +104,7 @@ export default Em.Component.extend({ }, findSearchTerms() { - const searchTerm = this.get('searchTerm'); + const searchTerm = escapeExpression(this.get('searchTerm')); if (!searchTerm) return [];