Skip to content
Permalink
Browse files
Improve validation of CSS selector-based cosmetic filters
Reported internally. The following invalid filter was not
discarded by uBO:

    123tvnow.com##.123tv-ads

The correct form should be:

    123tvnow.com##.\31 23tv-ads

Not discarding invalid CSS selector-based cosmetic
filter may break CSS selector-based cosmetic
filtering.
  • Loading branch information
gorhill authored and JustOff committed Jun 18, 2020
1 parent 3d979a0 commit 14adfa63fd8e7979ccb784f519185390b4477cb7
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/js/static-ext-filtering.js
@@ -96,7 +96,7 @@
}
// Quick regex-based validation -- most cosmetic filters are of the
// simple form and in such case a regex is much faster.
var reSimple = /^[#.][\w-]+$/;
var reSimple = /^[#.][A-Za-z_][\w-]*$/;
return function(s) {
if ( reSimple.test(s) ) { return true; }
try {

0 comments on commit 14adfa6

Please sign in to comment.