Skip to content

Commit

Permalink
Prevent the creation of non-cosmetic extended filters in element picker
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Nov 19, 2022
1 parent 86c8023 commit 4475305
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/js/epicker-ui.js
Expand Up @@ -113,11 +113,10 @@ const filterFromTextarea = function() {
const sfp = staticFilteringParser;
sfp.analyze(filter);
sfp.analyzeExtra();
if (
sfp.category !== sfp.CATStaticExtFilter &&
sfp.category !== sfp.CATStaticNetFilter ||
sfp.shouldDiscard()
) {
if ( sfp.shouldDiscard() ) { return '!'; }
if ( sfp.category === sfp.CATStaticExtFilter ) {
if ( sfp.hasFlavor(sfp.BITFlavorExtCosmetic) === false ) { return '!'; }
} else if ( sfp.category !== sfp.CATStaticNetFilter ) {
return '!';
}
return filter;
Expand Down

0 comments on commit 4475305

Please sign in to comment.