mirror of https://github.com/gorhill/uBlock.git
Can't have whitespace in network filter pattern
Related feedback: - https://github.com/uBlockOrigin/uAssets/discussions/17538#discussioncomment-6137462
This commit is contained in:
parent
d590390431
commit
e5bd7556d9
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue