Merge remote-tracking branch 'origin/v10/dev' into v10/feature/nullable-reference-types-in-Umbraco-Core
# Conflicts: # build/build.ps1 # src/Umbraco.Core/Configuration/ConfigConnectionString.cs # src/Umbraco.Core/Configuration/Models/ConnectionStrings.cs # src/Umbraco.Core/Install/InstallSteps/TelemetryIdentifierStep.cs # src/Umbraco.Core/Models/ContentType.cs # src/Umbraco.Infrastructure/Migrations/Install/DatabaseBuilder.cs # tests/Umbraco.Tests.AcceptanceTest/package.json
This commit is contained in:
@@ -24,7 +24,7 @@ namespace Umbraco.Extensions
|
||||
/// <returns></returns>
|
||||
public static string GetControllerName(Type controllerType)
|
||||
{
|
||||
if (!controllerType.Name.EndsWith("Controller"))
|
||||
if (!controllerType.Name.EndsWith("Controller") && !controllerType.Name.EndsWith("Controller`1"))
|
||||
{
|
||||
throw new InvalidOperationException("The controller type " + controllerType + " does not follow conventions, MVC Controller class names must be suffixed with the term 'Controller'");
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@ namespace Umbraco.Extensions
|
||||
public static class FriendlyUrlHelperExtensions
|
||||
{
|
||||
|
||||
private static IUmbracoContext UmbracoContext { get; } =
|
||||
private static IUmbracoContext UmbracoContext =>
|
||||
StaticServiceProvider.Instance.GetRequiredService<IUmbracoContextAccessor>().GetRequiredUmbracoContext();
|
||||
|
||||
private static IDataProtectionProvider DataProtectionProvider { get; } =
|
||||
|
||||
@@ -6,6 +6,7 @@ using System.Threading.Tasks;
|
||||
using Microsoft.AspNetCore.Http;
|
||||
using Microsoft.AspNetCore.Http.Extensions;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using Microsoft.Extensions.Primitives;
|
||||
using Umbraco.Cms.Core.Configuration.Models;
|
||||
using Umbraco.Cms.Core.Routing;
|
||||
|
||||
@@ -136,5 +137,25 @@ namespace Umbraco.Extensions
|
||||
|
||||
return new Uri(routingSettings.UmbracoApplicationUrl);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the Umbraco `ufprt` encrypted string from the current request
|
||||
/// </summary>
|
||||
/// <param name="request">The current request</param>
|
||||
/// <returns>The extracted `ufprt` token.</returns>
|
||||
public static string GetUfprt(this HttpRequest request)
|
||||
{
|
||||
if (request.HasFormContentType && request.Form.TryGetValue("ufprt", out StringValues formVal) && formVal != StringValues.Empty)
|
||||
{
|
||||
return formVal.ToString();
|
||||
}
|
||||
|
||||
if (request.Query.TryGetValue("ufprt", out StringValues queryVal) && queryVal != StringValues.Empty)
|
||||
{
|
||||
return queryVal.ToString();
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user