Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bug] Missing escape for filterInput RegExp (v3.0.9) #167

Open
Cyrille37 opened this issue May 7, 2020 · 0 comments
Open

[bug] Missing escape for filterInput RegExp (v3.0.9) #167

Cyrille37 opened this issue May 7, 2020 · 0 comments

Comments

@Cyrille37
Copy link

Hi,

You're missing user input escaping before construct the RegExp. Actually if you input a ')' in filter input it throws a SyntaxError: Invalid regular expression: /abc)/: Unmatched ')'

    var filterInput = $.trim(dualListbox.elements['filterInput'+selectIndex].val());
    filterInput = filterInput.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
    var regex = new RegExp(filterInput, 'gi')

Cheers

@Cyrille37 Cyrille37 changed the title [bug] Missing escape for filterInput RegExp [bug] Missing escape for filterInput RegExp (v3.0.9) May 7, 2020
Cyrille37 added a commit to Cyrille37/bootstrap-duallistbox that referenced this issue May 7, 2020
Cyrille37 added a commit to Cyrille37/bootstrap-duallistbox that referenced this issue May 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant