-
Notifications
You must be signed in to change notification settings - Fork 781
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
HTML Reporter: Fix encoding of label for urlConfig multi-value item
* Add test coverage for QUnit.config.urlConfig items with object as value. The urlConfig feature is mostly covered by `/test/reporter-urlparams.html` already, but what isn't covered yet is an item with an object value, where option labels can be customised. * In adding tests I noticed that, when urlConfig is used to create a multi-value option (rather than string, as is more common), then `val.label` was not escaped, which meant that if labels were to contain mention of an HTML tag or otherwise contain "<" and ">", these could glitch and break part of the toolbar rendering. This is unlikely to be exploitable, e.g. not controlled by URL parameters, and generally populated with literals. Even dynamic menus that feed dropdown contents from external input are fine, since this affects the top-level label only. Improve docs: * Avoid the overloaded word "option". Instead using the word "item" consistently when referring to urlConfig items, to avoid confusion with the `<select>` options inside of the array. * Remove odd inline snippet using `value = ;`. This was solely to satisfy ESLint run on Markdown, but is simply confusing. The array was redundant with the full example lower down, and I've now added a full example with an object value as well.
- Loading branch information
Showing
3 changed files
with
102 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters