From 68cf80168937a8a8050905504c0856ee72091480 Mon Sep 17 00:00:00 2001 From: Bjarne Fyrstenborg Date: Tue, 16 Aug 2022 21:31:51 +0200 Subject: [PATCH] Replace uppercase chars to make behaviour consistent --- .../Models/RequestHandlerSettings.cs | 54 ++++++++++--------- .../RequestHandlerSettingsExtension.cs | 9 ++-- 2 files changed, 34 insertions(+), 29 deletions(-) diff --git a/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs b/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs index 0c5d39f47a..dee888edf0 100644 --- a/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs +++ b/src/Umbraco.Core/Configuration/Models/RequestHandlerSettings.cs @@ -19,30 +19,36 @@ public class RequestHandlerSettings internal static readonly CharItem[] DefaultCharCollection = { - new () { Char = " ", Replacement = "-" }, - new () { Char = "\"", Replacement = string.Empty }, - new () { Char = "'", Replacement = string.Empty }, - new () { Char = "%", Replacement = string.Empty }, - new () { Char = ".", Replacement = string.Empty }, - new () { Char = ";", Replacement = string.Empty }, - new () { Char = "/", Replacement = string.Empty }, - new () { Char = "\\", Replacement = string.Empty }, - new () { Char = ":", Replacement = string.Empty }, - new () { Char = "#", Replacement = string.Empty }, - new () { Char = "+", Replacement = "plus" }, - new () { Char = "*", Replacement = "star" }, - new () { Char = "&", Replacement = string.Empty }, - new () { Char = "?", Replacement = string.Empty }, - new () { Char = "æ", Replacement = "ae" }, - new () { Char = "ä", Replacement = "ae" }, - new () { Char = "ø", Replacement = "oe" }, - new () { Char = "ö", Replacement = "oe" }, - new () { Char = "å", Replacement = "aa" }, - new () { Char = "ü", Replacement = "ue" }, - new () { Char = "ß", Replacement = "ss" }, - new () { Char = "|", Replacement = "-" }, - new () { Char = "<", Replacement = string.Empty }, - new () { Char = ">", Replacement = string.Empty }, + new() { Char = " ", Replacement = "-" }, + new() { Char = "\"", Replacement = string.Empty }, + new() { Char = "'", Replacement = string.Empty }, + new() { Char = "%", Replacement = string.Empty }, + new() { Char = ".", Replacement = string.Empty }, + new() { Char = ";", Replacement = string.Empty }, + new() { Char = "/", Replacement = string.Empty }, + new() { Char = "\\", Replacement = string.Empty }, + new() { Char = ":", Replacement = string.Empty }, + new() { Char = "#", Replacement = string.Empty }, + new() { Char = "&", Replacement = string.Empty }, + new() { Char = "?", Replacement = string.Empty }, + new() { Char = "<", Replacement = string.Empty }, + new() { Char = ">", Replacement = string.Empty }, + new() { Char = "+", Replacement = "plus" }, + new() { Char = "*", Replacement = "star" }, + new() { Char = "æ", Replacement = "ae" }, + new() { Char = "Æ", Replacement = "ae" }, + new() { Char = "ä", Replacement = "ae" }, + new() { Char = "Ä", Replacement = "ae" }, + new() { Char = "ø", Replacement = "oe" }, + new() { Char = "Ø", Replacement = "oe" }, + new() { Char = "ö", Replacement = "oe" }, + new() { Char = "Ö", Replacement = "oe" }, + new() { Char = "å", Replacement = "aa" }, + new() { Char = "Å", Replacement = "aa" }, + new() { Char = "ü", Replacement = "ue" }, + new() { Char = "Ü", Replacement = "ue" }, + new() { Char = "ß", Replacement = "ss" }, + new() { Char = "|", Replacement = "-" }, }; /// diff --git a/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs b/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs index 475f093785..10ea5a02ed 100644 --- a/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs +++ b/src/Umbraco.Core/Extensions/RequestHandlerSettingsExtension.cs @@ -7,13 +7,13 @@ namespace Umbraco.Extensions; /// /// Get concatenated user and default character replacements -/// taking into account +/// taking into account . /// public static class RequestHandlerSettingsExtension { /// /// Get concatenated user and default character replacements - /// taking into account + /// taking into account . /// public static IEnumerable GetCharReplacements(this RequestHandlerSettings requestHandlerSettings) { @@ -34,7 +34,7 @@ public static class RequestHandlerSettingsExtension } /// - /// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection + /// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection. /// internal static void MergeReplacements( this RequestHandlerSettings requestHandlerSettings, @@ -71,8 +71,7 @@ public static class RequestHandlerSettingsExtension } /// - /// Merges two IEnumerable of CharItem without any duplicates, items in priorityReplacements will override those in - /// alternativeReplacements + /// Merges two IEnumerable of CharItem without any duplicates, items in priorityReplacements will override those in alternativeReplacements. /// private static IEnumerable MergeUnique( IEnumerable priorityReplacements,