From 59ba5248f56a468ac885634d98b4b57488066f37 Mon Sep 17 00:00:00 2001 From: gorhill Date: Mon, 18 Sep 2017 13:06:36 -0400 Subject: [PATCH] fix #3034 --- src/js/static-net-filtering.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/js/static-net-filtering.js b/src/js/static-net-filtering.js index 85f05d7fc..ed1c74908 100644 --- a/src/js/static-net-filtering.js +++ b/src/js/static-net-filtering.js @@ -1777,12 +1777,18 @@ FilterParser.prototype.parse = function(raw) { // https://github.com/gorhill/uBlock/issues/1669#issuecomment-224822448 // remove pointless leading *. + // https://github.com/gorhill/uBlock/issues/3034 + // - We can remove anchoring if we need to match all at the start. if ( s.startsWith('*') ) { s = s.replace(/^\*+([^%0-9a-z])/, '$1'); + this.anchor &= ~0x6; } // remove pointless trailing * + // https://github.com/gorhill/uBlock/issues/3034 + // - We can remove anchoring if we need to match all at the end. if ( s.endsWith('*') ) { s = s.replace(/([^%0-9a-z])\*+$/, '$1'); + this.anchor &= ~0x1; } // nothing left?