From f9977a9fd8d5bfbd1a5cb21b9dd1c2c2ae1fddaf Mon Sep 17 00:00:00 2001 From: Shannon Deminick Date: Tue, 29 Jan 2013 21:19:16 +0600 Subject: [PATCH] Fixes: #U4-1170 - template with hyphen or dash --- src/Umbraco.Web/Mvc/RenderRouteHandler.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs index 73a0916c36..c22a602fc3 100644 --- a/src/Umbraco.Web/Mvc/RenderRouteHandler.cs +++ b/src/Umbraco.Web/Mvc/RenderRouteHandler.cs @@ -271,9 +271,10 @@ namespace Umbraco.Web.Mvc // to the index Action if (publishedContentRequest.HasTemplate) { - //check if the custom controller has an action with the same name as the template name (we convert ToUmbracoAlias since the template name might have invalid chars). - //NOTE: This also means that all custom actions MUST be PascalCase.. but that should be standard. - var templateName = publishedContentRequest.Template.Alias.Split('.')[0].ToUmbracoAlias(StringAliasCaseType.PascalCase); + //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]; def.ActionName = templateName; }