1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-24 03:12:46 +01:00

Harden detection of // in style declaration

Related feedback:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1811#issuecomment-966323765
This commit is contained in:
Raymond Hill 2021-11-11 09:05:10 -05:00
parent cf34200421
commit 9fbc50f14f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2

View File

@ -1564,6 +1564,7 @@ Parser.prototype.SelectorCompiler = class {
// https://github.com/uBlockOrigin/uBlock-issues/issues/668
// https://github.com/uBlockOrigin/uBlock-issues/issues/1693
// https://github.com/uBlockOrigin/uBlock-issues/issues/1811
// Forbid instances of:
// - `image-set(`
// - `url(`
@ -1571,7 +1572,7 @@ Parser.prototype.SelectorCompiler = class {
// - backslashes `\`
// - opening comment `/*`
compileStyleProperties(s) {
if ( /image-set\(|url\(|\/\/|\\|\/\*/i.test(s) ) { return; }
if ( /image-set\(|url\(|\/\s*\/|\\|\/\*/i.test(s) ) { return; }
if ( this.stylesheet === null ) { return s; }
let valid = false;
try {