File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -496,15 +496,17 @@ function addDomain() {
496496 return ;
497497 }
498498
499- for ( var i = 0 ; i < domains . length ; i ++ ) {
500- if ( kind === "exact" && wildcardChecked ) {
501- // Transform domain to wildcard if specified by user
502- domains [ i ] = "(\\.|^)" + domains [ i ] . replaceAll ( "." , "\\." ) + "$" ;
503- kind = "regex" ;
504-
505- // strip leading "*." if specified by user in wildcard mode
499+ // Check if the wildcard checkbox was marked and transform the domains into regex
500+ if ( kind === "exact" && wildcardChecked ) {
501+ for ( var i = 0 ; i < domains . length ; i ++ ) {
502+ // Strip leading "*." if specified by user in wildcard mode
506503 if ( domains [ i ] . startsWith ( "*." ) ) domains [ i ] = domains [ i ] . substr ( 2 ) ;
504+
505+ // Transform domain into a wildcard regex
506+ domains [ i ] = "(\\.|^)" + domains [ i ] . replaceAll ( "." , "\\." ) + "$" ;
507507 }
508+
509+ kind = "regex" ;
508510 }
509511
510512 // determine list type
You can’t perform that action at this time.
0 commit comments