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

Fix spurious rejection of some AdGuard redirect filters

Lines in AdGuard filter lists have trailing `\r`
characters, and these caused the redirect engine
compile code to reject as invalid the redirect
token.

This is trivially fixed by trimming the raw option
strings before parsing it in the redirect engine.
This commit is contained in:
Raymond Hill 2020-07-13 09:33:38 -04:00
parent ba0d4f8a38
commit d49a9dce66
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -460,7 +460,7 @@ RedirectEngine.prototype.compileRuleFromStaticFilter = function(line) {
let type,
redirect = '',
srchns = [];
for ( const option of matches[3].split(',') ) {
for ( const option of matches[3].trim().split(/,/) ) {
if ( option.startsWith('redirect=') ) {
redirect = option.slice(9);
continue;