From 8359ea5862afe8dd0e020f18e26d7229b0807d1a Mon Sep 17 00:00:00 2001 From: lkoruba Date: Fri, 29 Jun 2018 15:08:35 +0200 Subject: [PATCH] Revoke files where string is not concatenated --- src/Umbraco.Core/Components/BootLoader.cs | 2 +- src/Umbraco.Core/Persistence/DbConnectionExtensions.cs | 2 +- src/Umbraco.Core/Runtime/CoreRuntime.cs | 2 +- src/Umbraco.Core/Services/Implement/UserService.cs | 2 +- src/Umbraco.Core/Sync/DatabaseServerMessenger.cs | 4 ++-- src/Umbraco.Web/Editors/PasswordChanger.cs | 10 +++++----- .../PropertyEditors/ImageCropperPropertyValueEditor.cs | 2 +- 7 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/Umbraco.Core/Components/BootLoader.cs b/src/Umbraco.Core/Components/BootLoader.cs index 35ab6ff79a..f11657d634 100644 --- a/src/Umbraco.Core/Components/BootLoader.cs +++ b/src/Umbraco.Core/Components/BootLoader.cs @@ -347,7 +347,7 @@ namespace Umbraco.Core.Components { if (_booted == false) { - _proflog.Logger.Warn(() => "Cannot terminate, has not booted."); + _proflog.Logger.Warn("Cannot terminate, has not booted."); return; } diff --git a/src/Umbraco.Core/Persistence/DbConnectionExtensions.cs b/src/Umbraco.Core/Persistence/DbConnectionExtensions.cs index 0bbce78223..8f501c0aaa 100644 --- a/src/Umbraco.Core/Persistence/DbConnectionExtensions.cs +++ b/src/Umbraco.Core/Persistence/DbConnectionExtensions.cs @@ -65,7 +65,7 @@ namespace Umbraco.Core.Persistence catch (DbException e) { // Don't swallow this error, the exception is super handy for knowing "why" its not available - Current.Logger.Warn(e, () => "Configured database is reporting as not being available."); + Current.Logger.Warn(e, "Configured database is reporting as not being available."); return false; } diff --git a/src/Umbraco.Core/Runtime/CoreRuntime.cs b/src/Umbraco.Core/Runtime/CoreRuntime.cs index 4ea4361972..a3652b3330 100644 --- a/src/Umbraco.Core/Runtime/CoreRuntime.cs +++ b/src/Umbraco.Core/Runtime/CoreRuntime.cs @@ -315,7 +315,7 @@ namespace Umbraco.Core.Runtime catch (Exception e) { // can connect to the database but cannot access the migration table... need to install - logger.Warn(e, () => "Could not check the upgrade state."); + logger.Warn(e, "Could not check the upgrade state."); logger.Debug("Could not check the upgrade state, need to install Umbraco."); _state.Level = RuntimeLevel.Install; return; diff --git a/src/Umbraco.Core/Services/Implement/UserService.cs b/src/Umbraco.Core/Services/Implement/UserService.cs index 30428e694c..96cac1d814 100644 --- a/src/Umbraco.Core/Services/Implement/UserService.cs +++ b/src/Umbraco.Core/Services/Implement/UserService.cs @@ -333,7 +333,7 @@ namespace Umbraco.Core.Services.Implement // if we are upgrading and an exception occurs, log and swallow it if (_isUpgrading == false) throw; - Logger.Warn(ex, () => "An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored"); + Logger.Warn(ex, "An error occurred attempting to save a user instance during upgrade, normally this warning can be ignored"); // we don't want the uow to rollback its scope! scope.Complete(); diff --git a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs index 35b5334801..a1b89e58bc 100644 --- a/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs +++ b/src/Umbraco.Core/Sync/DatabaseServerMessenger.cs @@ -142,7 +142,7 @@ namespace Umbraco.Core.Sync var idle =_syncIdle.WaitOne(5000); if (idle == false) { - Logger.Warn(() => "The wait lock timed out, application is shutting down. The current instruction batch will be re-processed."); + Logger.Warn("The wait lock timed out, application is shutting down. The current instruction batch will be re-processed."); } }, weight); @@ -178,7 +178,7 @@ namespace Umbraco.Core.Sync { // we haven't synced - in this case we aren't going to sync the whole thing, we will assume this is a new // server and it will need to rebuild it's own caches, eg Lucene or the xml cache file. - Logger.Warn(() => "No last synced Id found, this generally means this is a new server/install." + Logger.Warn("No last synced Id found, this generally means this is a new server/install." + " The server will build its caches and indexes, and then adjust its last synced Id to the latest found in" + " the database and maintain cache updates based on that Id."); diff --git a/src/Umbraco.Web/Editors/PasswordChanger.cs b/src/Umbraco.Web/Editors/PasswordChanger.cs index 7aa8c88848..08f010ecd4 100644 --- a/src/Umbraco.Web/Editors/PasswordChanger.cs +++ b/src/Umbraco.Web/Editors/PasswordChanger.cs @@ -188,7 +188,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - _logger.Warn(ex, () => "Could not reset member password"); + _logger.Warn(ex, "Could not reset member password"); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not reset password, error: " + ex.Message + " (see log for full details)", new[] { "resetPassword" }) }); } } @@ -213,7 +213,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - _logger.Warn(ex, () => "Could not change member password"); + _logger.Warn(ex, "Could not change member password"); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, error: " + ex.Message + " (see log for full details)", new[] { "value" }) }); } } @@ -242,7 +242,7 @@ namespace Umbraco.Web.Editors } catch (Exception ex) { - _logger.Warn(ex, () => "Could not change member password"); + _logger.Warn(ex, "Could not change member password"); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, error: " + ex.Message + " (see log for full details)", new[] { "value" }) }); } } @@ -274,14 +274,14 @@ namespace Umbraco.Web.Editors } catch (Exception ex1) { - _logger.Warn(ex1, () => "Could not change member password"); + _logger.Warn(ex1, "Could not change member password"); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, error: " + ex1.Message + " (see log for full details)", new[] { "value" }) }); } } catch (Exception ex2) { - _logger.Warn(ex2, () => "Could not retrieve member password"); + _logger.Warn(ex2, "Could not retrieve member password"); return Attempt.Fail(new PasswordChangedModel { ChangeError = new ValidationResult("Could not change password, error: " + ex2.Message + " (see log for full details)", new[] { "value" }) }); } } diff --git a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs index 2e873b5178..98e8346441 100644 --- a/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs +++ b/src/Umbraco.Web/PropertyEditors/ImageCropperPropertyValueEditor.cs @@ -78,7 +78,7 @@ namespace Umbraco.Web.PropertyEditors catch (Exception ex) { // for some reason the value is invalid so continue as if there was no value there - _logger.Warn(ex, () => "Could not parse current db value to a JObject."); + _logger.Warn(ex, "Could not parse current db value to a JObject."); } if (string.IsNullOrWhiteSpace(currentPath) == false) currentPath = _mediaFileSystem.GetRelativePath(currentPath);