Opened 7 months ago

Closed 3 months ago

#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

  1. Try to use site.xxx#$#abort-current-inline-script window.Object wi'n
  2. See the resulting RegExp will not match the string wi'n
  3. 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.

Change History (2)

comment:1 Changed 7 months ago by mjethani

  • Description modified (diff)

comment:2 Changed 3 months ago by sebastian

  • Keywords closed-in-favor-of-gitlab added
  • Resolution set to rejected
  • Status changed from new to closed

Sorry, but we switched to GitLab. If this issue is still relevant, please file it again in the new issue tracker.

Note: See TracTickets for help on using tickets.