Skip to content

Commit

Permalink
Fix improper invalidation of valid uritransform exception filters
Browse files Browse the repository at this point in the history
  • Loading branch information
gorhill committed Feb 14, 2024
1 parent f2d7413 commit 21ec5a2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/js/codemirror/ubo-static-filtering.js
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,7 @@ CodeMirror.defineMode('ubo-static-filtering', function() {
case sfp.NODE_TYPE_NET_OPTION_NAME_SCRIPT:
case sfp.NODE_TYPE_NET_OPTION_NAME_SHIDE:
case sfp.NODE_TYPE_NET_OPTION_NAME_TO:
case sfp.NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM:
case sfp.NODE_TYPE_NET_OPTION_NAME_XHR:
case sfp.NODE_TYPE_NET_OPTION_NAME_WEBRTC:
case sfp.NODE_TYPE_NET_OPTION_NAME_WEBSOCKET:
Expand Down
5 changes: 3 additions & 2 deletions src/js/static-filtering-parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -1501,7 +1501,7 @@ export class AstFilterParser {
}
break;
}
case NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM:
case NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM: {
realBad = abstractTypeCount || behaviorTypeCount || unredirectableTypeCount;
if ( realBad ) { break; }
if ( isException !== true && this.options.trustedSource !== true ) {
Expand All @@ -1510,11 +1510,12 @@ export class AstFilterParser {
break;
}
const value = this.getNetOptionValue(NODE_TYPE_NET_OPTION_NAME_URLTRANSFORM);
if ( parseReplaceValue(value) === undefined ) {
if ( value !== '' && parseReplaceValue(value) === undefined ) {
this.astError = AST_ERROR_OPTION_BADVALUE;
realBad = true;
}
break;
}
case NODE_TYPE_NET_OPTION_NAME_REMOVEPARAM:
realBad = abstractTypeCount || behaviorTypeCount;
break;
Expand Down

0 comments on commit 21ec5a2

Please sign in to comment.