1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-09-15 15:32:28 +02:00

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

View File

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