1
0
mirror of https://github.com/gorhill/uBlock.git synced 2024-11-02 08:52:45 +01:00
Raymond Hill 2023-01-25 18:05:06 -05:00
parent b3f9a87ed8
commit c600cbbd3a
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
2 changed files with 7 additions and 5 deletions

View File

@ -1489,6 +1489,7 @@ export class AstFilterParser {
} }
getNetOptionValue(type) { getNetOptionValue(type) {
if ( this.nodeTypeRegister.includes(type) === false ) { return ''; }
const optionNode = this.nodeTypeLookupTable[type]; const optionNode = this.nodeTypeLookupTable[type];
if ( optionNode === 0 ) { return ''; } if ( optionNode === 0 ) { return ''; }
const valueNode = this.findDescendantByType(optionNode, NODE_TYPE_NET_OPTION_VALUE); const valueNode = this.findDescendantByType(optionNode, NODE_TYPE_NET_OPTION_VALUE);

View File

@ -3336,15 +3336,16 @@ class FilterCompiler {
this.processMethodOption(parser.getNetOptionValue(id)); this.processMethodOption(parser.getNetOptionValue(id));
this.optionUnitBits |= this.METHOD_BIT; this.optionUnitBits |= this.METHOD_BIT;
break; break;
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECT: case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECT: {
if ( this.action === AllowAction ) { const actualId = this.action === AllowAction
id = sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE; ? sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE
} : id;
if ( this.processModifierOption(id, parser.getNetOptionValue(id)) === false ) { if ( this.processModifierOption(actualId, parser.getNetOptionValue(id)) === false ) {
return false; return false;
} }
this.optionUnitBits |= this.REDIRECT_BIT; this.optionUnitBits |= this.REDIRECT_BIT;
break; break;
}
case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE: case sfp.NODE_TYPE_NET_OPTION_NAME_REDIRECTRULE:
if ( this.processModifierOption(id, parser.getNetOptionValue(id)) === false ) { if ( this.processModifierOption(id, parser.getNetOptionValue(id)) === false ) {
return false; return false;