diff --git a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs index 306a02bb5b..b4f5d19ba6 100644 --- a/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs +++ b/src/Umbraco.Tests/Routing/RenderRouteHandlerTests.cs @@ -64,7 +64,8 @@ namespace Umbraco.Tests.Routing } //test all template name styles to match the ActionName - [TestCase("home-page")] + [TestCase("home-\\234^^*32page")] + [TestCase("home-page")] [TestCase("Home-Page")] [TestCase("HomePage")] [TestCase("homePage")] @@ -84,7 +85,9 @@ namespace Umbraco.Tests.Routing handler.GetHandlerForRoute(routingContext.UmbracoContext.HttpContext.Request.RequestContext, docRequest); Assert.AreEqual("CustomDocument", routeData.Values["controller"].ToString()); - Assert.AreEqual("HomePage", routeData.Values["action"].ToString()); + Assert.AreEqual( + global::umbraco.cms.helpers.Casing.SafeAlias(templateName), + routeData.Values["action"].ToString()); } diff --git a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs index 30bac69666..53047d3c3a 100644 --- a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs @@ -274,7 +274,7 @@ namespace Umbraco.Web.Mvc //the template Alias should always be already saved with a safe name. //if there are hyphens in the name and there is a hijacked route, then the Action will need to be attributed // with the action name attribute. - var templateName = publishedContentRequest.Template.Alias.Split('.')[0]; + var templateName = global::umbraco.cms.helpers.Casing.SafeAlias(publishedContentRequest.Template.Alias.Split('.')[0]); def.ActionName = templateName; }