From 391a5c99c7eb32e9c988929ffb74e28ab713ef69 Mon Sep 17 00:00:00 2001 From: Raymond Hill Date: Mon, 30 Nov 2020 12:02:36 -0500 Subject: [PATCH] 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 --- src/js/static-filtering-parser.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/js/static-filtering-parser.js b/src/js/static-filtering-parser.js index 912e2f975..d19004bbd 100644 --- a/src/js/static-filtering-parser.js +++ b/src/js/static-filtering-parser.js @@ -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