diff --git a/common/ASC.Common/Logging/SelfCleaningAppender.cs b/common/ASC.Common/Logging/SelfCleaningAppender.cs index 5eca630b79..a790bacf4d 100644 --- a/common/ASC.Common/Logging/SelfCleaningAppender.cs +++ b/common/ASC.Common/Logging/SelfCleaningAppender.cs @@ -27,14 +27,14 @@ namespace ASC.Common.Logging; public class SelfCleaningAppender : RollingFileAppender { - private static DateTime s_lastCleanDate; - private static int? s_cleanPeriod; + private static DateTime _lastCleanDate; + private static int? _cleanPeriod; protected override void Append(LoggingEvent loggingEvent) { - if (DateTime.UtcNow.Date > s_lastCleanDate.Date) + if (DateTime.UtcNow.Date > _lastCleanDate.Date) { - s_lastCleanDate = DateTime.UtcNow.Date; + _lastCleanDate = DateTime.UtcNow.Date; Clean(); } @@ -43,9 +43,9 @@ public class SelfCleaningAppender : RollingFileAppender protected override void Append(LoggingEvent[] loggingEvents) { - if (DateTime.UtcNow.Date > s_lastCleanDate.Date) + if (DateTime.UtcNow.Date > _lastCleanDate.Date) { - s_lastCleanDate = DateTime.UtcNow.Date; + _lastCleanDate = DateTime.UtcNow.Date; Clean(); } @@ -54,9 +54,9 @@ public class SelfCleaningAppender : RollingFileAppender private static int GetCleanPeriod() { - if (s_cleanPeriod != null) + if (_cleanPeriod != null) { - return s_cleanPeriod.Value; + return _cleanPeriod.Value; } const string key = "CleanPeriod"; @@ -69,7 +69,7 @@ public class SelfCleaningAppender : RollingFileAppender int.TryParse(repo.Properties[key].ToString(), out value); } - s_cleanPeriod = value; + _cleanPeriod = value; return value; } diff --git a/common/ASC.Common/Logging/SelfCleaningTarget.cs b/common/ASC.Common/Logging/SelfCleaningTarget.cs index 6be0839189..4a97e0c3d1 100644 --- a/common/ASC.Common/Logging/SelfCleaningTarget.cs +++ b/common/ASC.Common/Logging/SelfCleaningTarget.cs @@ -30,14 +30,14 @@ namespace ASC.Common.Logging; [Target("SelfCleaning")] public class SelfCleaningTarget : FileTarget { - private static DateTime s_lastCleanDate; - private static int? s_cleanPeriod; + private static DateTime _lastCleanDate; + private static int? _cleanPeriod; protected override void Write(IList logEvents) { - if (DateTime.UtcNow.Date > s_lastCleanDate.Date) + if (DateTime.UtcNow.Date > _lastCleanDate.Date) { - s_lastCleanDate = DateTime.UtcNow.Date; + _lastCleanDate = DateTime.UtcNow.Date; Clean(); } @@ -60,9 +60,9 @@ public class SelfCleaningTarget : FileTarget protected override void Write(LogEventInfo logEvent) { - if (DateTime.UtcNow.Date > s_lastCleanDate.Date) + if (DateTime.UtcNow.Date > _lastCleanDate.Date) { - s_lastCleanDate = DateTime.UtcNow.Date; + _lastCleanDate = DateTime.UtcNow.Date; Clean(); } @@ -71,9 +71,9 @@ public class SelfCleaningTarget : FileTarget private static int GetCleanPeriod() { - if (s_cleanPeriod != null) + if (_cleanPeriod != null) { - return s_cleanPeriod.Value; + return _cleanPeriod.Value; } var value = 30; @@ -90,7 +90,7 @@ public class SelfCleaningTarget : FileTarget } } - s_cleanPeriod = value; + _cleanPeriod = value; return value; } diff --git a/common/ASC.Common/Security/Authorizing/AzObjectIdHelper.cs b/common/ASC.Common/Security/Authorizing/AzObjectIdHelper.cs index 69dd7dc877..5cd96a1c1c 100644 --- a/common/ASC.Common/Security/Authorizing/AzObjectIdHelper.cs +++ b/common/ASC.Common/Security/Authorizing/AzObjectIdHelper.cs @@ -28,7 +28,7 @@ namespace ASC.Common.Security.Authorizing; public static class AzObjectIdHelper { - private static readonly string s_separator = "|"; + private static readonly string _separator = "|"; public static string GetFullObjectId(ISecurityObjectId objectId) { @@ -37,6 +37,6 @@ public static class AzObjectIdHelper return null; } - return $"{objectId.ObjectType.FullName}{s_separator}{objectId.SecurityId}"; + return $"{objectId.ObjectType.FullName}{_separator}{objectId.SecurityId}"; } } diff --git a/common/ASC.Common/Utils/CrossPlatformUtils.cs b/common/ASC.Common/Utils/CrossPlatformUtils.cs index b4bfe15b68..b26ac4ddfc 100644 --- a/common/ASC.Common/Utils/CrossPlatformUtils.cs +++ b/common/ASC.Common/Utils/CrossPlatformUtils.cs @@ -27,11 +27,11 @@ namespace ASC.Common.Utils; public static class CrossPlatform { - private static char[] s_pathSplitCharacters = new char[] { '/', '\\' }; + private static char[] _pathSplitCharacters = new char[] { '/', '\\' }; public static string PathCombine(string basePath, params string[] additional) { - var splits = additional.Select(s => s.Split(s_pathSplitCharacters)).ToArray(); + var splits = additional.Select(s => s.Split(_pathSplitCharacters)).ToArray(); var totalLength = splits.Sum(arr => arr.Length); var segments = new string[totalLength + 1]; segments[0] = basePath; diff --git a/common/ASC.Common/Utils/HtmlUtil.cs b/common/ASC.Common/Utils/HtmlUtil.cs index 80763c5a5c..b82050af93 100644 --- a/common/ASC.Common/Utils/HtmlUtil.cs +++ b/common/ASC.Common/Utils/HtmlUtil.cs @@ -27,17 +27,17 @@ namespace ASC.Common.Utils; public static class HtmlUtil { - private static readonly Regex s_tagReplacer + private static readonly Regex _tagReplacer = new Regex("<[^>]*>", RegexOptions.Multiline | RegexOptions.Compiled); - private static readonly Regex s_commentsReplacer + private static readonly Regex _commentsReplacer = new Regex("", RegexOptions.Singleline | RegexOptions.IgnoreCase | RegexOptions.Compiled); - private static readonly Regex s_xssReplacer + private static readonly Regex _xssReplacer = new Regex(@"<\s*(style|script)[^>]*>(.*?)<\s*/\s*(style|script)>", RegexOptions.IgnoreCase | RegexOptions.CultureInvariant | RegexOptions.Compiled | RegexOptions.Singleline); - private static readonly Regex s_worder = + private static readonly Regex _worder = new Regex(@"\S+", RegexOptions.Compiled | RegexOptions.IgnoreCase | RegexOptions.CultureInvariant); public static string GetText(string html, int maxLength = 0, string endBlockTemplate = "...") @@ -46,19 +46,19 @@ public static class HtmlUtil if (!string.IsNullOrEmpty(html)) { - html = s_xssReplacer.Replace(html, string.Empty); //Clean malicious tags.