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

Fix matching of filters with trailing ^|

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.
This commit is contained in:
Raymond Hill 2020-06-10 09:53:21 -04:00
parent bc7f149252
commit d784fda98b
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -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) {