Revert "Replace uppercase chars to make behaviour consistent"

This reverts commit 68cf801689.
This commit is contained in:
Sebastiaan Janssen
2022-09-08 09:47:00 +02:00
parent a0d673262c
commit 5f42cf0cf7
2 changed files with 29 additions and 34 deletions

View File

@@ -19,36 +19,30 @@ 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 = 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 = "-" },
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 },
};
/// <summary>

View File

@@ -7,13 +7,13 @@ namespace Umbraco.Extensions;
/// <summary>
/// Get concatenated user and default character replacements
/// taking into account <see cref="RequestHandlerSettings.EnableDefaultCharReplacements" />.
/// taking into account <see cref="RequestHandlerSettings.EnableDefaultCharReplacements" />
/// </summary>
public static class RequestHandlerSettingsExtension
{
/// <summary>
/// Get concatenated user and default character replacements
/// taking into account <see cref="RequestHandlerSettings.EnableDefaultCharReplacements" />.
/// taking into account <see cref="RequestHandlerSettings.EnableDefaultCharReplacements" />
/// </summary>
public static IEnumerable<CharItem> GetCharReplacements(this RequestHandlerSettings requestHandlerSettings)
{
@@ -34,7 +34,7 @@ public static class RequestHandlerSettingsExtension
}
/// <summary>
/// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection.
/// Merges CharCollection and UserDefinedCharCollection, prioritizing UserDefinedCharCollection
/// </summary>
internal static void MergeReplacements(
this RequestHandlerSettings requestHandlerSettings,
@@ -71,7 +71,8 @@ public static class RequestHandlerSettingsExtension
}
/// <summary>
/// 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
/// </summary>
private static IEnumerable<CharItem> MergeUnique(
IEnumerable<CharItem> priorityReplacements,