mirror of
https://gitee.com/dotnetchina/SqlSugar.git
synced 2025-07-16 16:50:41 +08:00
Optimize the code ToCheckFiled
This commit is contained in:
parent
0004fb9f97
commit
e7c893d15a
@ -23,5 +23,7 @@ namespace SqlSugar
|
|||||||
public static Func<List<SplitTableInfo>> SplitTableGetTablesFunc;
|
public static Func<List<SplitTableInfo>> SplitTableGetTablesFunc;
|
||||||
|
|
||||||
public static bool Check_StringIdentity = true;
|
public static bool Check_StringIdentity = true;
|
||||||
|
|
||||||
|
public static Func<string,string> Check_FieldFunc;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -66,7 +66,14 @@ namespace SqlSugar
|
|||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public static string ToCheckField(this string value)
|
public static string ToCheckField(this string value)
|
||||||
{
|
{
|
||||||
if (value != null)
|
//You can override it because the default security level is very high
|
||||||
|
if (StaticConfig.Check_FieldFunc != null)
|
||||||
|
{
|
||||||
|
return StaticConfig.Check_FieldFunc(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Default method
|
||||||
|
else if (value != null)
|
||||||
{
|
{
|
||||||
if (value.IsContainsIn(";", "--"))
|
if (value.IsContainsIn(";", "--"))
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user