Fix handling of end-anchor in redirect patterns

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/872

An end-anchor was treated as literal `|` in the redirect
pattern to match instead of as a end-of-string condition.
This commit is contained in:
Raymond Hill 2020-02-01 12:47:17 -05:00
parent e37447779b
commit 1d51927d2e
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 1 additions and 0 deletions

View File

@ -446,6 +446,7 @@ RedirectEngine.prototype.compileRuleFromStaticFilter = function(line) {
.replace(/\*/g, '[\\w.%-]*')
.replace(/\./g, '\\.') +
path
.replace(/\|$/, '$')
.replace(/[.+?{}()|[\]\/\\]/g, '\\$&')
.replace(/\^/g, '[^\\w.%-]')
.replace(/\*/g, '.*?');