Skip to content

Commit

Permalink
Fix computing the path of nested lists
Browse files Browse the repository at this point in the history
Regression from:
- uBlockOrigin/uBlock-issues#1034

Nested lists must have their path computed from their
parent list path, not from the path of the root list.
  • Loading branch information
gorhill committed May 20, 2020
1 parent 229bc8c commit a5a4471
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/js/assets.js
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,10 @@ api.fetchFilterList = async function(mainlistURL) {
if ( match === null ) { break; }
if ( toParsedURL(match[1]) !== undefined ) { 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; }
sublistURLs.add(subURL);
out.push(
Expand Down

0 comments on commit a5a4471

Please sign in to comment.