mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-05 18:32:30 +01:00
Forbid usage of opening comment /*
in query-selectable test
Related issue: - https://github.com/uBlockOrigin/uBlock-issues/issues/1806
This commit is contained in:
parent
d8fea7f568
commit
630d436342
@ -333,7 +333,7 @@ const Parser = class {
|
||||
if (
|
||||
this.selectorCompiler.compile(
|
||||
selector,
|
||||
hasBits(this.flavorBits, BITFlavorExtStrong),
|
||||
hasBits(this.flavorBits, BITFlavorExtStrong | BITFlavorExtStyle),
|
||||
this.result
|
||||
) === false
|
||||
) {
|
||||
@ -1450,11 +1450,15 @@ Parser.prototype.SelectorCompiler = class {
|
||||
return true;
|
||||
}
|
||||
|
||||
// https://github.com/uBlockOrigin/uBlock-issues/issues/1806
|
||||
// Forbid instances of:
|
||||
// - opening comment `/*`
|
||||
querySelectable(s) {
|
||||
if ( this.reSimpleSelector.test(s) ) { return true; }
|
||||
if ( this.div === null ) { return true; }
|
||||
try {
|
||||
this.div.querySelector(`${s},${s}:not(#foo)`);
|
||||
if ( s.includes('/*') ) { return false; }
|
||||
} catch (ex) {
|
||||
return false;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user