mirror of
https://github.com/gorhill/uBlock.git
synced 2024-11-10 09:07:54 +01:00
Unescaped escaped commas in regex-based removeparam values
Related discussion: - https://github.com/uBlockOrigin/uAssets/discussions/14683#discussioncomment-3559284
This commit is contained in:
parent
2fc5cd0a14
commit
f806438de6
1 changed files with 5 additions and 1 deletions
|
@ -3427,6 +3427,8 @@ class FilterCompiler {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// https://github.com/uBlockOrigin/uAssets/discussions/14683#discussioncomment-3559284
|
||||||
|
// If the removeparam value is a regex, unescape escaped commas
|
||||||
extractTokenFromQuerypruneValue() {
|
extractTokenFromQuerypruneValue() {
|
||||||
const pattern = this.modifyValue;
|
const pattern = this.modifyValue;
|
||||||
if ( pattern === '*' || pattern.charCodeAt(0) === 0x7E /* '~' */ ) {
|
if ( pattern === '*' || pattern.charCodeAt(0) === 0x7E /* '~' */ ) {
|
||||||
|
@ -3434,7 +3436,9 @@ class FilterCompiler {
|
||||||
}
|
}
|
||||||
const match = /^\/(.+)\/i?$/.exec(pattern);
|
const match = /^\/(.+)\/i?$/.exec(pattern);
|
||||||
if ( match !== null ) {
|
if ( match !== null ) {
|
||||||
return this.extractTokenFromRegex(match[1]);
|
return this.extractTokenFromRegex(
|
||||||
|
match[1].replace(/(\{\d*)\\,/, '$1,')
|
||||||
|
);
|
||||||
}
|
}
|
||||||
if ( pattern.startsWith('|') ) {
|
if ( pattern.startsWith('|') ) {
|
||||||
return this.extractTokenFromRegex('\\b' + pattern.slice(1));
|
return this.extractTokenFromRegex('\\b' + pattern.slice(1));
|
||||||
|
|
Loading…
Reference in a new issue