I ran into this issue again, this time on a different site.
The cause is the following:
In /lib/filterClasses.js
Code: Select all
// Remove leading wildcards
if (source[0] == "*")
source = source.substr(1);
// Remove trailing wildcards
let pos = source.length - 1;
if (pos >= 0 && source[pos] == "*")
source = source.substr(0, pos);
source = source.replace(/\^\|$/, "^") // remove anchors following separator placeholder
.replace(/\W/g, "\\$&") // escape special symbols
.replace(/\\\*/g, ".*") // replace wildcards by .*
// process separator placeholders (all ANSI charaters but alphanumeric characters and _%.-)
.replace(/\\\^/g, "(?:[\\x00-\\x24\\x26-\\x2C\\x2F\\x3A-\\x40\\x5B-\\x5E\\x60\\x7B-\\x80]|$)")
.replace(/^\\\|\\\|/, "^[\\w\\-]+:\\/+(?!\\/)(?:[^.\\/]+\\.)*?") // process extended anchor at expression start
.replace(/^\\\|/, "^") // process anchor at expression start
.replace(/\\\|$/, "$"); // process anchor at expression end
The first two if-statements will change
into
which will then be converted to the regexes
Code: Select all
foo$
^foo
^[\\w\\-]+:\\/+(?!\\/)(?:[^.\\/]+\\.)*?foo
instead of the regexes
Can you please fix this? Thanks.
(And while you're at it, please replace
Code: Select all
// process separator placeholders (all ANSI charaters but alphanumeric characters and _%.-)
.replace(/\\\^/g, "(?:[\\x00-\\x24\\x26-\\x2C\\x2F\\x3A-\\x40\\x5B-\\x5E\\x60\\x7B-\\x80]|$)")
by
Code: Select all
// process separator placeholders (all ANSI characters but alphanumeric characters and _%.-)
.replace(/\\\^/g, "(?:[\\x00-\\x24\\x26-\\x2C\\x2F\\x3A-\\x40\\x5B-\\x5E\\x60\\x7B-\\x7F]|$)")
to fix the typo in characters as well as that character x80 (= 128 = €) isn't ANSI anymore)
So the fixed code would be:
Code: Select all
// Remove leading wildcards
if (source[0] == "*" && source[1] != "|")
source = source.substr(1);
// Remove trailing wildcards
let pos = source.length - 1;
if (pos >= 0 && source[pos] == "*" && source[pos-1] != "|")
source = source.substr(0, pos);
source = source.replace(/\^\|$/, "^") // remove anchors following separator placeholder
.replace(/\W/g, "\\$&") // escape special symbols
.replace(/\\\*/g, ".*") // replace wildcards by .*
// process separator placeholders (all ANSI characters but alphanumeric characters and _%.-)
.replace(/\\\^/g, "(?:[\\x00-\\x24\\x26-\\x2C\\x2F\\x3A-\\x40\\x5B-\\x5E\\x60\\x7B-\\x7F]|$)")
.replace(/^\\\|\\\|/, "^[\\w\\-]+:\\/+(?!\\/)(?:[^.\\/]+\\.)*?") // process extended anchor at expression start
.replace(/^\\\|/, "^") // process anchor at expression start
.replace(/\\\|$/, "$"); // process anchor at expression end