1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-22 02:12:44 +01:00

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; }