Skip to content

Commit

Permalink
Fix token position value when removing leading wildcard
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Feb 2, 2020
1 parent 1d51927 commit a95ef16
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/js/static-net-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -2531,10 +2531,13 @@ const FilterParser = class {
// https://www.reddit.com/r/uBlockOrigin/comments/dpcvfx/
// Since we found a valid token, we can get rid of leading/trailing
// wildcards if any.
// https://github.com/gorhill/uBlock/commit/7971b223855d#commitcomment-37077525
// Mind that changing the pattern may change token start index.
if ( this.firstWildcardPos === 0 ) {
this.f = this.f.slice(1);
this.firstWildcardPos = this.secondWildcardPos;
this.secondWildcardPos = -1;
this.tokenBeg -= 1;
}
if ( this.firstWildcardPos !== -1 ) {
const lastCharPos = this.f.length - 1;
Expand Down

3 comments on commit a95ef16

@uBlock-user
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

capture

reverse lookup not working with filter placed in My Filters.

@gorhill
Copy link
Owner Author

@gorhill gorhill commented on a95ef16 Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok this is not trivial to fix, this will require revisiting the previous fix.

@gorhill
Copy link
Owner Author

@gorhill gorhill commented on a95ef16 Feb 3, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.