From f1cddd91c6e85e4ed454fa42578eb98ca1728aef Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Thu, 26 Sep 2024 09:54:43 +0200 Subject: [PATCH 1/5] Missing context complete (cherry picked from commit fdb9cfa3e7ada8db6effb6ce7cb9a58f09817538) --- .../Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs index 67bdaf7395..461ed59c8e 100644 --- a/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs +++ b/src/Umbraco.Infrastructure/Migrations/Upgrade/V_14_0_0/AddGuidsToUserGroups.cs @@ -23,6 +23,7 @@ public class AddGuidsToUserGroups : UnscopedMigrationBase // If the new column already exists we'll do nothing. if (ColumnExists(Constants.DatabaseSchema.Tables.UserGroup, NewColumnName)) { + Context.Complete(); return; } @@ -31,10 +32,12 @@ public class AddGuidsToUserGroups : UnscopedMigrationBase if (DatabaseType != DatabaseType.SQLite) { MigrateSqlServer(); + Context.Complete(); return; } MigrateSqlite(); + Context.Complete(); } private void MigrateSqlServer() From c9c9374de1150019f6d484b74038742edd1d1e93 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Thu, 26 Sep 2024 14:39:12 +0200 Subject: [PATCH 2/5] update backoffice submodule --- src/Umbraco.Web.UI.Client | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Umbraco.Web.UI.Client b/src/Umbraco.Web.UI.Client index a5500fd8de..b2c598f6ef 160000 --- a/src/Umbraco.Web.UI.Client +++ b/src/Umbraco.Web.UI.Client @@ -1 +1 @@ -Subproject commit a5500fd8de2fb14285d8f99cd3d5edeb1c5eb462 +Subproject commit b2c598f6ef0b62bb64186c61125f4d00177b48ca From 762d72b0184c44e739d8d544d30aa1396a7eb8e3 Mon Sep 17 00:00:00 2001 From: NguyenThuyLan <116753400+NguyenThuyLan@users.noreply.github.com> Date: Wed, 25 Sep 2024 18:19:09 +0700 Subject: [PATCH 3/5] update ImageSharpMiddlewareOption for fixing invalid width and height (#17126) Co-authored-by: Lan Nguyen Thuy (cherry picked from commit 9b19d63a6a4ea44bd4b56bbb0874284a1bc5ba52) --- .../ConfigureImageSharpMiddlewareOptions.cs | 23 ++++++++++++++----- 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs b/src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs index 9a1ecead89..1ef672270e 100644 --- a/src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs +++ b/src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs @@ -1,3 +1,4 @@ +using System.Globalization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Headers; using Microsoft.Extensions.Options; @@ -48,16 +49,26 @@ public sealed class ConfigureImageSharpMiddlewareOptions : IConfigureOptions(context.Commands.GetValueOrDefault(ResizeWebProcessor.Width), context.Culture); - if (width <= 0 || width > _imagingSettings.Resize.MaxWidth) + if (context.Commands.Contains(ResizeWebProcessor.Width)) { - context.Commands.Remove(ResizeWebProcessor.Width); + if (!int.TryParse(context.Commands.GetValueOrDefault(ResizeWebProcessor.Width), NumberStyles.Integer, + CultureInfo.InvariantCulture, out var width) + || width < 0 + || width >= _imagingSettings.Resize.MaxWidth) + { + context.Commands.Remove(ResizeWebProcessor.Width); + } } - int height = context.Parser.ParseValue(context.Commands.GetValueOrDefault(ResizeWebProcessor.Height), context.Culture); - if (height <= 0 || height > _imagingSettings.Resize.MaxHeight) + if (context.Commands.Contains(ResizeWebProcessor.Height)) { - context.Commands.Remove(ResizeWebProcessor.Height); + if (!int.TryParse(context.Commands.GetValueOrDefault(ResizeWebProcessor.Height), NumberStyles.Integer, + CultureInfo.InvariantCulture, out var height) + || height < 0 + || height >= _imagingSettings.Resize.MaxHeight) + { + context.Commands.Remove(ResizeWebProcessor.Height); + } } return Task.CompletedTask; From 46604909be4a3ab9f5e9a1ed32542fbe45e074ee Mon Sep 17 00:00:00 2001 From: NguyenThuyLan <116753400+nguyenthuylan@users.noreply.github.com> Date: Fri, 27 Sep 2024 07:41:55 +0200 Subject: [PATCH 4/5] Fix error format code (#17146) * update ImageSharpMiddlewareOption for fixing invalid width and height (#17126) Co-authored-by: Lan Nguyen Thuy * Fix issue format parameters --------- Co-authored-by: Lan Nguyen Thuy (cherry picked from commit 9a12eea495c4122b941bd21c5afd7726cf87d920) --- .../ConfigureImageSharpMiddlewareOptions.cs | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs b/src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs index 1ef672270e..79fcd0a9bf 100644 --- a/src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs +++ b/src/Umbraco.Cms.Imaging.ImageSharp/ConfigureImageSharpMiddlewareOptions.cs @@ -51,8 +51,11 @@ public sealed class ConfigureImageSharpMiddlewareOptions : IConfigureOptions= _imagingSettings.Resize.MaxWidth) { @@ -62,8 +65,11 @@ public sealed class ConfigureImageSharpMiddlewareOptions : IConfigureOptions= _imagingSettings.Resize.MaxHeight) { From d57d12d54d95d1a4df22553692798973f90f29d7 Mon Sep 17 00:00:00 2001 From: Bjarke Berg Date: Fri, 27 Sep 2024 07:43:12 +0200 Subject: [PATCH 5/5] Fixed imagesharp 2 also --- .../ConfigureImageSharpMiddlewareOptions.cs | 33 +++++++++++++------ 1 file changed, 23 insertions(+), 10 deletions(-) diff --git a/src/Umbraco.Cms.Imaging.ImageSharp2/ConfigureImageSharpMiddlewareOptions.cs b/src/Umbraco.Cms.Imaging.ImageSharp2/ConfigureImageSharpMiddlewareOptions.cs index 8daa1b689b..dcc67bf5d3 100644 --- a/src/Umbraco.Cms.Imaging.ImageSharp2/ConfigureImageSharpMiddlewareOptions.cs +++ b/src/Umbraco.Cms.Imaging.ImageSharp2/ConfigureImageSharpMiddlewareOptions.cs @@ -1,3 +1,4 @@ +using System.Globalization; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Http.Headers; using Microsoft.Extensions.Options; @@ -47,20 +48,32 @@ public sealed class ConfigureImageSharpMiddlewareOptions : IConfigureOptions( - context.Commands.GetValueOrDefault(ResizeWebProcessor.Width), - context.Culture); - if (width <= 0 || width > _imagingSettings.Resize.MaxWidth) + if (context.Commands.Contains(ResizeWebProcessor.Width)) { - context.Commands.Remove(ResizeWebProcessor.Width); + if (!int.TryParse( + context.Commands.GetValueOrDefault(ResizeWebProcessor.Width), + NumberStyles.Integer, + CultureInfo.InvariantCulture, + out var width) + || width < 0 + || width >= _imagingSettings.Resize.MaxWidth) + { + context.Commands.Remove(ResizeWebProcessor.Width); + } } - var height = context.Parser.ParseValue( - context.Commands.GetValueOrDefault(ResizeWebProcessor.Height), - context.Culture); - if (height <= 0 || height > _imagingSettings.Resize.MaxHeight) + if (context.Commands.Contains(ResizeWebProcessor.Height)) { - context.Commands.Remove(ResizeWebProcessor.Height); + if (!int.TryParse( + context.Commands.GetValueOrDefault(ResizeWebProcessor.Height), + NumberStyles.Integer, + CultureInfo.InvariantCulture, + out var height) + || height < 0 + || height >= _imagingSettings.Resize.MaxHeight) + { + context.Commands.Remove(ResizeWebProcessor.Height); + } } return Task.CompletedTask;