diff --git a/FastReport.Base/Utils/Config.cs b/FastReport.Base/Utils/Config.cs index 7a5a9bdd..1546cb21 100644 --- a/FastReport.Base/Utils/Config.cs +++ b/FastReport.Base/Utils/Config.cs @@ -257,7 +257,6 @@ internal static void Init() scriptSecurityProps = new ScriptSecurityProperties(); #endif } - //RestoreScriptSecurity(); LoadPlugins(); // init TextRenderingHint.SystemDefault @@ -479,7 +478,7 @@ private static void RestoreRightToLeft() /// public class ScriptSecurityProperties { - private readonly string[] defaultBlackList = new[] + private readonly string[] defaultStopList = new[] { "GetType", "typeof", @@ -489,7 +488,7 @@ public class ScriptSecurityProperties "GetProcAddress", }; - private string[] blackList; + private string[] stopList; /// /// Add stubs for the most dangerous classes (in System.IO, System.Reflection etc) @@ -499,40 +498,40 @@ public class ScriptSecurityProperties /// /// List of keywords that shouldn't be declared in the report script /// - public string[] BlackList + public string[] StopList { - get { return (string[])blackList.Clone(); } + get { return (string[])stopList.Clone(); } set { if(value != null) { - OnBlackListChanged?.Invoke(this, null); - blackList = value; + OnStopListChanged?.Invoke(this, null); + stopList = value; } } } /// - /// Throws when has changed + /// Throws when has changed /// - public event EventHandler OnBlackListChanged; + public event EventHandler OnStopListChanged; internal ScriptSecurityProperties() { - SetDefaultBlackList(); + SetDefaultStopList(); } - internal ScriptSecurityProperties(string[] blackList) + internal ScriptSecurityProperties(string[] stopList) { - this.blackList = blackList; + this.stopList = stopList; } /// - /// Sets default value for + /// Sets default value for /// - public void SetDefaultBlackList() + public void SetDefaultStopList() { - BlackList = defaultBlackList; + StopList = defaultStopList; } } diff --git a/FastReport.Web.Base/ScriptSecurity.cs b/FastReport.Web.Base/ScriptSecurity.cs index a9c29d33..d9e50da9 100644 --- a/FastReport.Web.Base/ScriptSecurity.cs +++ b/FastReport.Web.Base/ScriptSecurity.cs @@ -78,7 +78,7 @@ public bool IsValid(Language lang, string reportScript, string[] references, Rep return false; } - foreach (string pattern in Config.ScriptSecurityProps.BlackList) + foreach (string pattern in Config.ScriptSecurityProps.StopList) { if (reportScript.IndexOf(pattern) != -1) return false;