@@ -940,7 +940,7 @@ private static void RemoveFilterDisabledConditionFromQuery(DbCommand command, Db
940
940
( paramIdx = command . CommandText . IndexOf ( param . ParameterName + " IS NOT NULL" , curIdx , StringComparison . OrdinalIgnoreCase ) ) != - 1 )
941
941
{
942
942
int startIdx = command . CommandText . LastIndexOf ( "or" , paramIdx , StringComparison . OrdinalIgnoreCase ) ;
943
- int endIdx = command . CommandText . IndexOf ( ')' , paramIdx ) ;
943
+ int endIdx = command . CommandText . IndexOf ( ")" , paramIdx , StringComparison . Ordinal ) ;
944
944
945
945
if ( endIdx == - 1 )
946
946
{
@@ -955,7 +955,7 @@ private static void RemoveFilterDisabledConditionFromQuery(DbCommand command, Db
955
955
// (note the extra ()'s which are not present in PostgreSQL).
956
956
// So while we found the ending ")", we may or may not want to actually remove it.
957
957
// Determine that by checking for the presence of an opening "(" in between the "or" and the parameter name
958
- var openingParenIndex = command . CommandText . IndexOf ( '(' , startIdx ) ;
958
+ var openingParenIndex = command . CommandText . IndexOf ( "(" , startIdx , StringComparison . Ordinal ) ;
959
959
if ( ( openingParenIndex < startIdx ) || ( openingParenIndex > paramIdx ) )
960
960
endIdx -- ; // Do not have opening paren so do not remove the trailing ")"!
961
961
}
@@ -996,7 +996,7 @@ private static void SetParameterList(IEnumerable paramValueCollection, DbParamet
996
996
int prevStartIndex = 0 ;
997
997
int paramStartIdx ;
998
998
bool isNotCondition = false ;
999
- while ( ( paramStartIdx = command . CommandText . IndexOf ( param . ParameterName , prevStartIndex ) ) != - 1 )
999
+ while ( ( paramStartIdx = command . CommandText . IndexOf ( param . ParameterName , prevStartIndex , StringComparison . OrdinalIgnoreCase ) ) != - 1 )
1000
1000
{
1001
1001
int startIdx = FindLastComparisonOperator ( command . CommandText , paramStartIdx , out isNotCondition ) ;
1002
1002
if ( startIdx == - 1 )
@@ -1058,11 +1058,11 @@ private static int FindLastComparisonOperator(string commandText, int fromIdx, o
1058
1058
// possible for us to match on a condition that is earlier in the sql statement.
1059
1059
1060
1060
// MySql uses "!=" syntax. Not possible to find both.
1061
- int notEqualIdx = commandText . LastIndexOf ( "!=" , fromIdx , 10 ) ;
1061
+ int notEqualIdx = commandText . LastIndexOf ( "!=" , fromIdx , 10 , StringComparison . Ordinal ) ;
1062
1062
if ( notEqualIdx == - 1 )
1063
- notEqualIdx = commandText . LastIndexOf ( "<>" , fromIdx , 10 ) ;
1063
+ notEqualIdx = commandText . LastIndexOf ( "<>" , fromIdx , 10 , StringComparison . Ordinal ) ;
1064
1064
1065
- int equalIdx = commandText . LastIndexOf ( "=" , fromIdx , 10 ) ;
1065
+ int equalIdx = commandText . LastIndexOf ( "=" , fromIdx , 10 , StringComparison . Ordinal ) ;
1066
1066
if ( equalIdx == notEqualIdx + 1 ) // Don't want to match on the "=" in "!="
1067
1067
equalIdx = - 1 ;
1068
1068
0 commit comments