From cacb889ee2910a47350cf04de56d42594ebcd3d7 Mon Sep 17 00:00:00 2001 From: SuhorukovAnton Date: Thu, 13 Jan 2022 15:04:28 +0300 Subject: [PATCH] analizators/U2U1100 --- common/ASC.Api.Core/Core/CustomHealthCheck.cs | 4 ++-- common/ASC.Common/Web/MimeMapping.cs | 2 +- .../LoginProviders/TelegramLoginProvider.cs | 2 +- common/ASC.Notify.Textile/TextileStyler.cs | 4 ++-- products/ASC.People/Server/Controllers/PeopleController.cs | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/common/ASC.Api.Core/Core/CustomHealthCheck.cs b/common/ASC.Api.Core/Core/CustomHealthCheck.cs index 57a8990396f..29b56aa66de 100644 --- a/common/ASC.Api.Core/Core/CustomHealthCheck.cs +++ b/common/ASC.Api.Core/Core/CustomHealthCheck.cs @@ -24,7 +24,7 @@ public static IServiceCollection AddCustomHealthCheck(this IServiceCollection se var connectionString = configurationExtension.GetConnectionStrings("default"); - if (String.Compare(connectionString.ProviderName, "MySql.Data.MySqlClient") == 0) + if (string.Equals(connectionString.ProviderName, "MySql.Data.MySqlClient")) { hcBuilder.AddMySql(connectionString.ConnectionString, name: "mysqldb", @@ -32,7 +32,7 @@ public static IServiceCollection AddCustomHealthCheck(this IServiceCollection se ); } - if (String.Compare(connectionString.ProviderName, "Npgsql") == 0) + if (string.Equals(connectionString.ProviderName, "Npgsql")) { hcBuilder.AddNpgSql(connectionString.ConnectionString, name: "postgredb", diff --git a/common/ASC.Common/Web/MimeMapping.cs b/common/ASC.Common/Web/MimeMapping.cs index e3cdf33aa06..5831431b2f3 100644 --- a/common/ASC.Common/Web/MimeMapping.cs +++ b/common/ASC.Common/Web/MimeMapping.cs @@ -852,7 +852,7 @@ public static string GetExtention(string mimeMapping) foreach (DictionaryEntry entry in extensionToMimeMappingTable) { var mime = (string)entry.Value; - if (mime == mimeMapping.ToLowerInvariant()) return (string)entry.Key; + if (mime.Equals(mimeMapping, StringComparison.OrdinalIgnoreCase)) return (string)entry.Key; if (!mimeSynonyms.ContainsKey(mime)) continue; if (mimeSynonyms[mime].Contains(mimeMapping.ToLowerInvariant())) return (string)entry.Key; } diff --git a/common/ASC.FederatedLogin/LoginProviders/TelegramLoginProvider.cs b/common/ASC.FederatedLogin/LoginProviders/TelegramLoginProvider.cs index 3a863053406..a918e260147 100644 --- a/common/ASC.FederatedLogin/LoginProviders/TelegramLoginProvider.cs +++ b/common/ASC.FederatedLogin/LoginProviders/TelegramLoginProvider.cs @@ -83,7 +83,7 @@ public TelegramLoginProvider( public bool ValidateKeys() { - if (TelegramBotToken == "") + if (TelegramBotToken.Length == 0) { TelegramHelper.DisableClient(TenantManager.GetCurrentTenant().TenantId); return true; diff --git a/common/ASC.Notify.Textile/TextileStyler.cs b/common/ASC.Notify.Textile/TextileStyler.cs index 1ba89b26102..795f119e5a8 100644 --- a/common/ASC.Notify.Textile/TextileStyler.cs +++ b/common/ASC.Notify.Textile/TextileStyler.cs @@ -152,7 +152,7 @@ private string GetLogoImg(NoticeMessage message, string imagePath) if (string.IsNullOrEmpty(logoImg)) { var logo = message.GetArgument("LetterLogo"); - if (logo != null && (string)logo.Value != "") + if (logo != null && ((string)logo.Value).Length != 0) { logoImg = (string)logo.Value; } @@ -173,7 +173,7 @@ private string GetLogoText(NoticeMessage message) if (string.IsNullOrEmpty(logoText)) { var llt = message.GetArgument("LetterLogoText"); - if (llt != null && (string)llt.Value != "") + if (llt != null && ((string)llt.Value).Length != 0) { logoText = (string)llt.Value; } diff --git a/products/ASC.People/Server/Controllers/PeopleController.cs b/products/ASC.People/Server/Controllers/PeopleController.cs index b48b26f846f..fb56fa28a65 100644 --- a/products/ASC.People/Server/Controllers/PeopleController.cs +++ b/products/ASC.People/Server/Controllers/PeopleController.cs @@ -1594,7 +1594,7 @@ public ICollection GetAuthProviders(bool inviteView, bool settingsV foreach (var provider in ProviderManager.AuthProviders.Where(provider => string.IsNullOrEmpty(fromOnly) || fromOnly == provider || (provider == "google" && fromOnly == "openid"))) { - if (inviteView && provider.ToLower() == "twitter") continue; + if (inviteView && provider.Equals("twitter", StringComparison.OrdinalIgnoreCase)) continue; var loginProvider = ProviderManager.GetLoginProvider(provider); if (loginProvider != null && loginProvider.IsEnabled)