From d975eaa8a9ef3f2889a2c4e844bcc84f3a7d4eb8 Mon Sep 17 00:00:00 2001 From: Robert Dima Date: Thu, 9 May 2024 12:47:47 +0300 Subject: [PATCH] Make MvcServicePath regex matching ignore case. --- DNN Platform/DotNetNuke.Web.Mvc/MvcHttpModule.cs | 4 ++-- .../HttpModules/MobileRedirect/MobileRedirectModule.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/DNN Platform/DotNetNuke.Web.Mvc/MvcHttpModule.cs b/DNN Platform/DotNetNuke.Web.Mvc/MvcHttpModule.cs index 7b5e1cb337b..4714736769f 100644 --- a/DNN Platform/DotNetNuke.Web.Mvc/MvcHttpModule.cs +++ b/DNN Platform/DotNetNuke.Web.Mvc/MvcHttpModule.cs @@ -23,7 +23,7 @@ namespace DotNetNuke.Web.Mvc public class MvcHttpModule : IHttpModule { - public static readonly Regex MvcServicePath = new Regex(@"DesktopModules/MVC/", RegexOptions.Compiled); + public static readonly Regex MvcServicePath = new Regex(@"DesktopModules/MVC/", RegexOptions.Compiled | RegexOptions.IgnoreCase); static MvcHttpModule() { @@ -47,7 +47,7 @@ public void Dispose() private static void InitDnn(object sender, EventArgs e) { var app = sender as HttpApplication; - if (app != null && MvcServicePath.IsMatch(app.Context.Request.RawUrl.ToLowerInvariant())) + if (app != null && MvcServicePath.IsMatch(app.Context.Request.RawUrl)) { Initialize.Init(app); } diff --git a/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs b/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs index 2f8f9deae9b..99cc283d172 100644 --- a/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs +++ b/DNN Platform/HttpModules/MobileRedirect/MobileRedirectModule.cs @@ -17,7 +17,7 @@ namespace DotNetNuke.HttpModules public class MobileRedirectModule : IHttpModule { private readonly IList specialPages = new List { "/login.aspx", "/register.aspx", "/terms.aspx", "/privacy.aspx", "/login", "/register", "/terms", "/privacy" }; - private readonly Regex mvcServicePath = new Regex(@"DesktopModules/MVC/", RegexOptions.Compiled); + private readonly Regex mvcServicePath = new Regex(@"DesktopModules/MVC/", RegexOptions.Compiled | RegexOptions.IgnoreCase); private IRedirectionController redirectionController; public string ModuleName => "MobileRedirectModule";