From 499c7bd7771092604c626db3af98db66fe3393ad Mon Sep 17 00:00:00 2001 From: Andy Henderson Date: Fri, 2 Oct 2009 19:23:06 +0000 Subject: [PATCH] Fixes URL case sensitivity problem when there's a path between a wiki and the site root. Resolves #359. --- AssemblyVersion.cs | 4 ++-- Core/Settings.cs | 9 ++++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index cfd5275..fea625a 100644 --- a/AssemblyVersion.cs +++ b/AssemblyVersion.cs @@ -16,5 +16,5 @@ using System.Reflection; // // You can specify all the values or you can default the Revision and Build Numbers // by using the '*' as shown below: -[assembly: AssemblyVersion("3.0.0.336")] -[assembly: AssemblyFileVersion("3.0.0.336")] +[assembly: AssemblyVersion("3.0.0.337")] +[assembly: AssemblyFileVersion("3.0.0.337")] diff --git a/Core/Settings.cs b/Core/Settings.cs index 659621d..0ba75e8 100644 --- a/Core/Settings.cs +++ b/Core/Settings.cs @@ -600,7 +600,14 @@ namespace ScrewTurn.Wiki { /// public static string CookiePath { get { - return HttpContext.Current.Request.ApplicationPath; + string requestUrl = HttpContext.Current.Request.RawUrl; + string virtualDirectory = HttpContext.Current.Request.ApplicationPath; + // We need to convert the case of the virtual directory to that used in the url + // Return the virtual directory as is if we can't find it in the URL + if (requestUrl.ToLower().Contains(virtualDirectory.ToLower())) { + return requestUrl.Substring(requestUrl.ToLower().IndexOf(virtualDirectory.ToLower()),virtualDirectory.Length); + } + return virtualDirectory; } }