Skip to content

Commit

Permalink
Fix matching of filters with trailing ^|
Browse files Browse the repository at this point in the history
Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/h08132/can_we_enable_javascript_on_the_homepage_but/ftkxvc5/

The right bound of the match needs to be incremented
when a trailing `^` matches a character.
  • Loading branch information
gorhill committed Jun 10, 2020
1 parent bc7f149 commit d784fda
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/js/static-net-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -1020,8 +1020,12 @@ registerFilterClass(FilterAnchorRight);

const FilterTrailingSeparator = class {
match() {
return $patternMatchRight === $requestURL.length ||
isSeparatorChar(bidiTrie.haystack[$patternMatchRight]);
if ( $patternMatchRight === $requestURL.length ) { return true; }
if ( isSeparatorChar(bidiTrie.haystack[$patternMatchRight]) ) {
$patternMatchRight += 1;
return true;
}
return false;
}

logData(details) {
Expand Down

0 comments on commit d784fda

Please sign in to comment.