Skip to content

Commit

Permalink
Fix spurious rejection of some AdGuard redirect filters
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
gorhill committed Jul 13, 2020
1 parent ba0d4f8 commit d49a9dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/js/redirect-engine.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit d49a9dc

Please sign in to comment.