1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-07 03:12:33 +01:00

Fix computing the path of nested lists

Regression from:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1034

Nested lists must have their path computed from their
parent list path, not from the path of the root list.
This commit is contained in:
Raymond Hill 2020-05-20 12:38:41 -04:00
parent 229bc8c0bf
commit a5a447186b
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -261,7 +261,10 @@ api.fetchFilterList = async function(mainlistURL) {
if ( match === null ) { break; } if ( match === null ) { break; }
if ( toParsedURL(match[1]) !== undefined ) { continue; } if ( toParsedURL(match[1]) !== undefined ) { continue; }
if ( match[1].indexOf('..') !== -1 ) { continue; } if ( match[1].indexOf('..') !== -1 ) { continue; }
const subURL = rootDirectoryURL.href + match[1]; // Compute nested list path relative to parent list path
const pos = result.url.lastIndexOf('/');
if ( pos === -1 ) { continue; }
const subURL = result.url.slice(0, pos + 1) + match[1];
if ( sublistURLs.has(subURL) ) { continue; } if ( sublistURLs.has(subURL) ) { continue; }
sublistURLs.add(subURL); sublistURLs.add(subURL);
out.push( out.push(