Fix unescaped backslashes in selector attribute

Related feedback:
- https://www.reddit.com/r/uBlockOrigin/comments/yjoh9p/
This commit is contained in:
Raymond Hill 2022-11-02 08:32:54 -04:00
parent 28b0d04c89
commit 42ddac5e3d
No known key found for this signature in database
GPG key ID: 25E1490B761470C2

View file

@ -1589,7 +1589,7 @@ Parser.prototype.SelectorCompiler = class {
if ( typeof value !== 'string' ) {
value = data.value.name;
}
value = value.replace(/"/g, '\\$&');
value = value.replace(/["\\]/g, '\\$&');
let flags = '';
if ( typeof data.flags === 'string' ) {
if ( /^(is?|si?)$/.test(data.flags) === false ) { return; }