merge v10 to v11

This commit is contained in:
Bjarke Berg
2022-08-18 14:38:28 +02:00
4076 changed files with 320268 additions and 303657 deletions

View File

@@ -1,27 +1,24 @@
// Copyright (c) Umbraco.
// See LICENSE for more details.
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using Umbraco.Cms.Core.Configuration.UmbracoSettings;
using Umbraco.Extensions;
namespace Umbraco.Cms.Core.Configuration.Models
{
/// <summary>
/// Typed configuration options for request handler settings.
/// </summary>
[UmbracoOptions(Constants.Configuration.ConfigRequestHandler)]
public class RequestHandlerSettings
{
internal const bool StaticAddTrailingSlash = true;
internal const string StaticConvertUrlsToAscii = "try";
internal const bool StaticEnableDefaultCharReplacements = true;
namespace Umbraco.Cms.Core.Configuration.Models;
internal static readonly Umbraco.Cms.Core.Configuration.Models.CharItem[] DefaultCharCollection =
{
/// <summary>
/// Typed configuration options for request handler settings.
/// </summary>
[UmbracoOptions(Constants.Configuration.ConfigRequestHandler)]
public class RequestHandlerSettings
{
internal const bool StaticAddTrailingSlash = true;
internal const string StaticConvertUrlsToAscii = "try";
internal const bool StaticEnableDefaultCharReplacements = true;
internal static readonly CharItem[] DefaultCharCollection =
{
new () { Char = " ", Replacement = "-" },
new () { Char = "\"", Replacement = string.Empty },
new () { Char = "'", Replacement = string.Empty },
@@ -45,40 +42,39 @@ namespace Umbraco.Cms.Core.Configuration.Models
new () { Char = "ß", Replacement = "ss" },
new () { Char = "|", Replacement = "-" },
new () { Char = "<", Replacement = string.Empty },
new () { Char = ">", Replacement = string.Empty }
};
new () { Char = ">", Replacement = string.Empty },
};
/// <summary>
/// Gets or sets a value indicating whether to add a trailing slash to URLs.
/// </summary>
[DefaultValue(StaticAddTrailingSlash)]
public bool AddTrailingSlash { get; set; } = StaticAddTrailingSlash;
/// <summary>
/// Gets or sets a value indicating whether to add a trailing slash to URLs.
/// </summary>
[DefaultValue(StaticAddTrailingSlash)]
public bool AddTrailingSlash { get; set; } = StaticAddTrailingSlash;
/// <summary>
/// Gets or sets a value indicating whether to convert URLs to ASCII (valid values: "true", "try" or "false").
/// </summary>
[DefaultValue(StaticConvertUrlsToAscii)]
public string ConvertUrlsToAscii { get; set; } = StaticConvertUrlsToAscii;
/// <summary>
/// Gets or sets a value indicating whether to convert URLs to ASCII (valid values: "true", "try" or "false").
/// </summary>
[DefaultValue(StaticConvertUrlsToAscii)]
public string ConvertUrlsToAscii { get; set; } = StaticConvertUrlsToAscii;
/// <summary>
/// Gets a value indicating whether URLs should be converted to ASCII.
/// </summary>
public bool ShouldConvertUrlsToAscii => ConvertUrlsToAscii.InvariantEquals("true");
/// <summary>
/// Gets a value indicating whether URLs should be converted to ASCII.
/// </summary>
public bool ShouldConvertUrlsToAscii => ConvertUrlsToAscii.InvariantEquals("true");
/// <summary>
/// Gets a value indicating whether URLs should be tried to be converted to ASCII.
/// </summary>
public bool ShouldTryConvertUrlsToAscii => ConvertUrlsToAscii.InvariantEquals("try");
/// <summary>
/// Gets a value indicating whether URLs should be tried to be converted to ASCII.
/// </summary>
public bool ShouldTryConvertUrlsToAscii => ConvertUrlsToAscii.InvariantEquals("try");
/// <summary>
/// Disable all default character replacements
/// </summary>
[DefaultValue(StaticEnableDefaultCharReplacements)]
public bool EnableDefaultCharReplacements { get; set; } = StaticEnableDefaultCharReplacements;
/// <summary>
/// Disable all default character replacements
/// </summary>
[DefaultValue(StaticEnableDefaultCharReplacements)]
public bool EnableDefaultCharReplacements { get; set; } = StaticEnableDefaultCharReplacements;
/// <summary>
/// Add additional character replacements, or override defaults
/// </summary>
public IEnumerable<Umbraco.Cms.Core.Configuration.Models.CharItem>? UserDefinedCharCollection { get; set; }
}
/// <summary>
/// Add additional character replacements, or override defaults
/// </summary>
public IEnumerable<CharItem>? UserDefinedCharCollection { get; set; }
}