Skip to content

Commit

Permalink
fix contains w/2 arguments on lower frameworks (#2639)
Browse files Browse the repository at this point in the history
  • Loading branch information
jennyf19 committed Jan 15, 2024
1 parent 15de647 commit d402e6b
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -844,8 +844,13 @@ private static void CheckAssertionsForInjectionAttempt(string assertion, string
{
if (!assertion.IsNullOrEmpty() || !subAssertion.IsNullOrEmpty())
{
#if NETSTANDARD2_0 || NET462 || NET472
if (!assertion.IsNullOrEmpty() && assertion.Contains('&')) throw new ArgumentException(IDWebErrorMessage.InvalidAssertion, nameof(assertion));
if (!subAssertion.IsNullOrEmpty() && subAssertion.Contains('&')) throw new ArgumentException(IDWebErrorMessage.InvalidSubAssertion, nameof(subAssertion));
#else
if (!assertion.IsNullOrEmpty() && assertion.Contains('&', StringComparison.InvariantCultureIgnoreCase)) throw new ArgumentException(IDWebErrorMessage.InvalidAssertion, nameof(assertion));
if (!subAssertion.IsNullOrEmpty() && (subAssertion.Contains('&', StringComparison.InvariantCultureIgnoreCase))) throw new ArgumentException(IDWebErrorMessage.InvalidSubAssertion, nameof(subAssertion));
if (!subAssertion.IsNullOrEmpty() && subAssertion.Contains('&', StringComparison.InvariantCultureIgnoreCase)) throw new ArgumentException(IDWebErrorMessage.InvalidSubAssertion, nameof(subAssertion));
#endif
}
}

Expand Down

0 comments on commit d402e6b

Please sign in to comment.