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

Set max token length on parser for consistent compilation

Reported internally. The issue could cause the logger
to be unable to successfully reverse-lookup a filter
list for a filter which had tokens longer than 6
characters followed by wildcard.

Regression from:
- 01b1ed9a98
This commit is contained in:
Raymond Hill 2020-06-07 08:50:20 -04:00
parent 15657a3f1e
commit 7dc962281f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -136,6 +136,7 @@ const fromNetFilter = async function(rawFilter) {
const µb = µBlock;
const writer = new µb.CompiledLineIO.Writer();
const parser = new vAPI.StaticFilteringParser();
parser.setMaxTokenLength(µb.urlTokenizer.MAX_TOKEN_LENGTH);
parser.analyze(rawFilter);
if ( µb.staticNetFilteringEngine.compile(parser, writer) === false ) {