Skip to content

Commit 9fbc50f

Browse files
committed
Harden detection of // in style declaration
Related feedback: - uBlockOrigin/uBlock-issues#1811 (comment)
1 parent cf34200 commit 9fbc50f

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/js/static-filtering-parser.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1564,14 +1564,15 @@ Parser.prototype.SelectorCompiler = class {
15641564

15651565
// https://github.com/uBlockOrigin/uBlock-issues/issues/668
15661566
// https://github.com/uBlockOrigin/uBlock-issues/issues/1693
1567+
// https://github.com/uBlockOrigin/uBlock-issues/issues/1811
15671568
// Forbid instances of:
15681569
// - `image-set(`
15691570
// - `url(`
15701571
// - any instance of `//`
15711572
// - backslashes `\`
15721573
// - opening comment `/*`
15731574
compileStyleProperties(s) {
1574-
if ( /image-set\(|url\(|\/\/|\\|\/\*/i.test(s) ) { return; }
1575+
if ( /image-set\(|url\(|\/\s*\/|\\|\/\*/i.test(s) ) { return; }
15751576
if ( this.stylesheet === null ) { return s; }
15761577
let valid = false;
15771578
try {

0 commit comments

Comments
 (0)