From 6d3c92873b0b1a38cc21bea4da267dc9253667ec Mon Sep 17 00:00:00 2001 From: Ben Date: Mon, 30 Dec 2019 11:57:40 +0800 Subject: [PATCH] DNN-34520: get the module id from query string correctly when redirect mixed case option enabled. --- DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs b/DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs index e1eaf089658..3967f5d2893 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/MvcHostControl.cs @@ -10,6 +10,7 @@ using System.Web.Routing; using System.Web.UI; using DotNetNuke.Collections; +using DotNetNuke.Common.Utilities; using DotNetNuke.ComponentModel; using DotNetNuke.Entities.Modules; using DotNetNuke.Entities.Modules.Actions; @@ -115,12 +116,19 @@ private ModuleRequestContext GetModuleRequestContext(HttpContextBase httpContext RouteData routeData; + var queryString = httpContext.Request.QueryString; + if (String.IsNullOrEmpty(_controlKey)) { - _controlKey = httpContext.Request.QueryString.GetValueOrDefault("ctl", String.Empty); + _controlKey = queryString.GetValueOrDefault("ctl", String.Empty); + } + + var moduleId = Null.NullInteger; + if (queryString["moduleid"] != null) + { + int.TryParse(queryString["moduleid"], out moduleId); } - var moduleId = httpContext.Request.QueryString.GetValueOrDefault("moduleId", -1); if (moduleId != ModuleContext.ModuleId && String.IsNullOrEmpty(_controlKey)) { //Set default routeData for module that is not the "selected" module