mirror of
https://github.com/gorhill/uBlock.git
synced 2024-09-22 13:47:43 +02:00
Fix token position value when removing leading wildcard
Related issue: - https://www.reddit.com/r/uBlockOrigin/comments/ex8ggg/ Regression from: - https://github.com/gorhill/uBlock/commit/7971b223855d
This commit is contained in:
parent
1d51927d2e
commit
a95ef16e06
1 changed files with 3 additions and 0 deletions
|
@ -2531,10 +2531,13 @@ const FilterParser = class {
|
||||||
// https://www.reddit.com/r/uBlockOrigin/comments/dpcvfx/
|
// https://www.reddit.com/r/uBlockOrigin/comments/dpcvfx/
|
||||||
// Since we found a valid token, we can get rid of leading/trailing
|
// Since we found a valid token, we can get rid of leading/trailing
|
||||||
// wildcards if any.
|
// 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 ) {
|
if ( this.firstWildcardPos === 0 ) {
|
||||||
this.f = this.f.slice(1);
|
this.f = this.f.slice(1);
|
||||||
this.firstWildcardPos = this.secondWildcardPos;
|
this.firstWildcardPos = this.secondWildcardPos;
|
||||||
this.secondWildcardPos = -1;
|
this.secondWildcardPos = -1;
|
||||||
|
this.tokenBeg -= 1;
|
||||||
}
|
}
|
||||||
if ( this.firstWildcardPos !== -1 ) {
|
if ( this.firstWildcardPos !== -1 ) {
|
||||||
const lastCharPos = this.f.length - 1;
|
const lastCharPos = this.f.length - 1;
|
||||||
|
|
Loading…
Reference in a new issue