Skip to content

Commit

Permalink
menu-applet: escape user input before using in RegExp
Browse files Browse the repository at this point in the history
prevents js errors when regex reserved characters are typed into
the search box.
  • Loading branch information
itzexor authored and mtwebster committed Nov 7, 2019
1 parent d8b9829 commit 6ba6a9a
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -2689,7 +2689,7 @@ class CinnamonMenuApplet extends Applet.TextIconApplet {

let res = [];
let exactMatch = null;
let regexpPattern = new RegExp("\\b"+pattern);
let regexpPattern = new RegExp("\\b" + Util.escapeRegExp(pattern));

for (let i in this._applicationsButtons) {
let app = this._applicationsButtons[i].app;
Expand Down

0 comments on commit 6ba6a9a

Please sign in to comment.