Fix the parsing of unsupported static network filter types

Related issue:
- https://github.com/gorhill/uBlock/issues/2283

This is a regression causing the referenced issue to no
longer be fixed. The regression was introduced when the
new static filtering parser code was introduced in version
1.28.0:

https://github.com/gorhill/uBlock/releases/tag/1.28.0
This commit is contained in:
Raymond Hill 2020-11-30 12:02:36 -05:00
parent d7e8e16fc5
commit 391a5c99c7
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 6 additions and 2 deletions

View File

@ -2380,7 +2380,6 @@ const NetOptionsIterator = class {
// Validate option according to context
if (
descriptor === undefined ||
hasBits(descriptor, OPTNotSupported) ||
ltok !== lopt &&
hasNoBits(descriptor, OPTCanNegate) ||
this.exception &&
@ -2419,7 +2418,12 @@ const NetOptionsIterator = class {
// Accumulate description bits
allBits |= descriptor;
// Mark slices in case of invalid filter option
if ( this.interactive && descriptor === OPTTokenInvalid ) {
if (
this.interactive && (
descriptor === OPTTokenInvalid ||
hasBits(descriptor, OPTNotSupported)
)
) {
this.parser.errorSlices(lopt, i);
}
// Store indices to raw slices, this will be used during iteration