Opened on 04/10/2019 at 01:21:33 PM
Closed on 08/29/2019 at 05:43:52 PM
#7455 closed defect (rejected)
snippets arguments containing quotes
Reported by: | agiammarchi | Assignee: | |
---|---|---|---|
Priority: | Unknown | Milestone: | |
Module: | Core | Keywords: | closed-in-favor-of-gitlab |
Cc: | Blocked By: | ||
Blocking: | Platform: | Unknown / Cross platform | |
Ready: | no | Confidential: | no |
Tester: | Unknown | Verified working: | no |
Review URL(s): |
Description (last modified by mjethani)
Summary
Any snippet that passes through parseScript function might be affected by a not so UX friendly bug.
How to reproduce
- Try to use site.xxx#$#abort-current-inline-script window.Object wi'n
- See the resulting RegExp will not match the string wi'n
- See that writing site.xxx#$#abort-current-inline-script window.Object wi\'n instead works, but see that writing an extra argument after won't
Observed behaviour
The parseScript function apparently eats, or misunderstands, single quotes parts of an argument that is being already parsed, and the resulting RegExp won't match the expected.
Expected behaviour
Either arguments containing ' should be mandatorily escaped and put in single quotes, or we need to change the parseScript logic so that when a single quote is encountered, but it's part of an argument being parsed (i.e. no space before) the quote shouldn't be considered as opener of the argument, but handled like any other chars.
This way expectations are preserved, and UX is improved for fancy cases, like in searching specific text that might contain single or double quotes.
Notes
This is a known quirk of the parser (#6853). We even have tests for it.
Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.