From 3dd32642e2b18aab23ecea23d98520355497a826 Mon Sep 17 00:00:00 2001 From: Andy Butland Date: Wed, 23 Apr 2025 20:05:41 +0200 Subject: [PATCH] Updated server-side dependencies to latest versions for Umbraco 16 (#19117) * Updated dependencies to latest versions. * Fixed breaking changes following dependency updates. * Limited NUnit updates to within the current major. * Fixed failing delivery API contract integration test. --- Directory.Packages.props | 55 +++++++++---------- .../RichTextEditorPastedImages.cs | 2 +- .../Mvc/HtmlStringUtilities.cs | 8 +-- tests/Directory.Packages.props | 16 +++--- .../DeliveryApi/OpenApiContractTest.cs | 2 +- 5 files changed, 41 insertions(+), 42 deletions(-) diff --git a/Directory.Packages.props b/Directory.Packages.props index 91221a6648..04809997fa 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -5,19 +5,19 @@ - + - - - - - - + + + + + + @@ -38,65 +38,64 @@ - - - - - + + + + - + - + - - - + + + - + - + - + - - + + - + - + - + - + - + - + diff --git a/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs b/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs index f0d2631773..216fe3fdd2 100644 --- a/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs +++ b/src/Umbraco.Infrastructure/PropertyEditors/RichTextEditorPastedImages.cs @@ -190,7 +190,7 @@ public sealed class RichTextEditorPastedImages }); } - img.SetAttributeValue("src", location); + img.SetAttributeValue("src", location ?? string.Empty); // Remove the data attribute (so we do not re-process this) img.Attributes.Remove(TemporaryImageDataAttribute); diff --git a/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs b/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs index a2a9ef5142..c2a975cb6f 100644 --- a/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs +++ b/src/Umbraco.Web.Common/Mvc/HtmlStringUtilities.cs @@ -30,13 +30,13 @@ public sealed class HtmlStringUtilities public HtmlString StripHtmlTags(string html, params string[]? tags) { - HtmlDocument doc = new HtmlDocument(); + var doc = new HtmlDocument(); doc.LoadHtml(html); - List targets = new List(); - HtmlNodeCollection nodes = doc.DocumentNode.SelectNodes(".//*"); + var targets = new List(); + HtmlNodeCollection? nodes = doc.DocumentNode.SelectNodes(".//*"); - if (nodes != null) + if (nodes is not null) { foreach (HtmlNode node in nodes) { diff --git a/tests/Directory.Packages.props b/tests/Directory.Packages.props index 5fc349ca8a..b3b0192c0b 100644 --- a/tests/Directory.Packages.props +++ b/tests/Directory.Packages.props @@ -5,21 +5,21 @@ - + - + - - + + - - + + - + - \ No newline at end of file + diff --git a/tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs b/tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs index 2e95b473f6..da1c8aa88e 100644 --- a/tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs +++ b/tests/Umbraco.Tests.Integration/Umbraco.Core/DeliveryApi/OpenApiContractTest.cs @@ -39,7 +39,7 @@ internal sealed class OpenApiContractTest : UmbracoTestServerTestBase private const string ExpectedOpenApiContract = """ { - "openapi": "3.0.1", + "openapi": "3.0.4", "info": { "title": "Umbraco Delivery API", "description": "You can find out more about the Umbraco Delivery API in [the documentation](https://docs.umbraco.com/umbraco-cms/reference/content-delivery-api).",