@@ -33,7 +33,7 @@ public ValidationResult ValidateCondition(ICondition condition)
3333 return ValidateRegexCondition ( regexCondition ) ;
3434 else if ( condition is DateRangeCondition dateRangeCondition )
3535 return ValidateDateRangeCondition ( dateRangeCondition ) ;
36-
36+
3737 return new ValidationResult ( true , null ) ;
3838 }
3939
@@ -55,7 +55,7 @@ private ValidationResult ValidateRegexCondition(RegexCondition condition)
5555
5656 private ValidationResult ValidateDateRangeCondition ( DateRangeCondition condition )
5757 {
58- if ( condition . StartDate . HasValue && condition . EndDate . HasValue &&
58+ if ( condition . StartDate . HasValue && condition . EndDate . HasValue &&
5959 condition . StartDate . Value > condition . EndDate . Value )
6060 return new ValidationResult ( false , "Start date cannot be after end date" ) ;
6161
@@ -124,7 +124,7 @@ private bool HasPotentiallyDangerousAlternation(string pattern)
124124 // If we can't parse it, be conservative
125125 return true ;
126126 }
127-
127+
128128 return false ;
129129 }
130130
@@ -137,12 +137,12 @@ private bool HasComplexNestedStructure(string pattern)
137137
138138 for ( int i = 0 ; i < chars . Length ; i ++ )
139139 {
140- if ( chars [ i ] == '(' && ( i == 0 || chars [ i - 1 ] != '\\ ' ) ) // Not escaped
140+ if ( chars [ i ] == '(' && ( i == 0 || chars [ i - 1 ] != '\\ ' ) ) // Not escaped
141141 {
142142 groupDepth ++ ;
143143 maxDepth = Math . Max ( maxDepth , groupDepth ) ;
144144 }
145- else if ( chars [ i ] == ')' && ( i == 0 || chars [ i - 1 ] != '\\ ' ) ) // Not escaped
145+ else if ( chars [ i ] == ')' && ( i == 0 || chars [ i - 1 ] != '\\ ' ) ) // Not escaped
146146 {
147147 groupDepth -- ;
148148 }
@@ -167,7 +167,7 @@ private bool HasComplexNestedStructure(string pattern)
167167 private bool HasSpecificDangerousPatterns ( string pattern )
168168 {
169169 // Check for specific patterns known to cause ReDoS
170-
170+
171171 // Look for nested quantifiers like ([^...]*.*)+ or (.*[^...]+)*
172172 if ( Regex . IsMatch ( pattern , @"\([^+*]*[\*\+][^+*]*\)[\*\+]" , RegexOptions . IgnoreCase ) )
173173 {
0 commit comments