This commit is contained in:
gorhill 2016-06-27 14:11:36 -04:00
parent fffa919d03
commit 72fdce64f0
1 changed files with 5 additions and 1 deletions

View File

@ -1566,7 +1566,11 @@ FilterParser.prototype.parse = function(raw) {
// normalize placeholders
if ( this.reHasWildcard.test(s) ) {
// remove pointless leading *
if ( s.startsWith('*') ) {
// https://github.com/gorhill/uBlock/issues/1669#issuecomment-224822448
// Keep the leading asterisk if we are dealing with a hostname-anchored
// filter, this will ensure the generic filter implementation is
// used.
if ( s.startsWith('*') && this.hostnameAnchored === false ) {
s = s.replace(/^\*+([^%0-9a-z])/, '$1');
}
// remove pointless trailing *