mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-03 09:39:38 +02: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
@ -98,7 +98,7 @@
|
||||
}
|
||||
// Quick regex-based validation -- most cosmetic filters are of the
|
||||
// simple form and in such case a regex is much faster.
|
||||
const reSimple = /^[#.][\w-]+$/;
|
||||
const reSimple = /^[#.][A-Za-z_][\w-]*$/;
|
||||
return s => {
|
||||
if ( reSimple.test(s) ) { return 1; }
|
||||
const pos = cssPseudoSelector(s);
|
||||
|
Loading…
Reference in New Issue
Block a user