Can't have whitespace in network filter pattern

Related feedback:
- https://github.com/uBlockOrigin/uAssets/discussions/17538#discussioncomment-6137462
This commit is contained in:
Raymond Hill 2023-06-15 09:12:06 -04:00
parent d590390431
commit e5bd7556d9
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 3 additions and 1 deletions

View File

@ -1638,12 +1638,14 @@ export class AstFilterParser {
pattern = pattern.slice(0, -ignoreLen);
}
const patternHasWhitespace = this.hasWhitespace &&
this.reHasWhitespaceChar.test(pattern);
const needNormalization = this.needPatternNormalization(pattern);
const normal = needNormalization
? this.normalizePattern(pattern)
: pattern;
next = this.allocTypedNode(NODE_TYPE_NET_PATTERN, patternBeg, patternEnd);
if ( normal === undefined ) {
if ( patternHasWhitespace || normal === undefined ) {
this.astTypeFlavor = AST_TYPE_NETWORK_PATTERN_BAD;
this.addFlags(AST_FLAG_HAS_ERROR);
this.astError = AST_ERROR_PATTERN;