Do not suggest network filters with wildcarded hostname in picker

Related issue:
- https://github.com/uBlockOrigin/uBlock-issues/issues/1494
This commit is contained in:
Raymond Hill 2021-02-22 07:57:23 -05:00
parent 007a123c63
commit b7a2352c6f
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 5 additions and 1 deletions

View File

@ -176,7 +176,11 @@ const mergeStrings = function(urls) {
merged = merged.replace(/^\*+$/, '')
.replace(/\*{2,}/g, '*')
.replace(/([^*]{1,3}\*)(?:[^*]{1,3}\*)+/g, '$1');
return merged;
// https://github.com/uBlockOrigin/uBlock-issues/issues/1494
let pos = merged.indexOf('/');
if ( pos === -1 ) { pos = merged.length; }
return merged.slice(0, pos).includes('*') ? urls[0] : merged;
};
/******************************************************************************/