mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-11 17:41:03 +01:00
Improve validation of CSS selector-based cosmetic filters
Reported internally. The following invalid filter was not discarded by uBO: 123tvnow.com##.123tv-ads The correct form should be: 123tvnow.com##.\31 23tv-ads Not discarding invalid CSS selector-based cosmetic filter may break CSS selector-based cosmetic filtering.
This commit is contained in:
parent
30ab587b95
commit
1d9421b8b2
1 changed files with 1 additions and 1 deletions
|
@ -98,7 +98,7 @@
|
||||||
}
|
}
|
||||||
// Quick regex-based validation -- most cosmetic filters are of the
|
// Quick regex-based validation -- most cosmetic filters are of the
|
||||||
// simple form and in such case a regex is much faster.
|
// simple form and in such case a regex is much faster.
|
||||||
const reSimple = /^[#.][\w-]+$/;
|
const reSimple = /^[#.][A-Za-z_][\w-]*$/;
|
||||||
return s => {
|
return s => {
|
||||||
if ( reSimple.test(s) ) { return 1; }
|
if ( reSimple.test(s) ) { return 1; }
|
||||||
const pos = cssPseudoSelector(s);
|
const pos = cssPseudoSelector(s);
|
||||||
|
|
Loading…
Reference in a new issue