From ab22f73cbbec92c372e3eaa8045b4ab3e182080f Mon Sep 17 00:00:00 2001 From: Dario Solera Date: Mon, 19 Oct 2009 07:18:43 +0000 Subject: [PATCH] Fixed theme detection when opening a namespace with incorrect casing. --- AssemblyVersion.cs | 4 ++-- Core/Settings.cs | 2 ++ Core/UrlTools.cs | 6 ++---- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index e4c257d..1fb0ba6 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.1.403")] -[assembly: AssemblyFileVersion("3.0.1.403")] +[assembly: AssemblyVersion("3.0.1.404")] +[assembly: AssemblyFileVersion("3.0.1.404")] diff --git a/Core/Settings.cs b/Core/Settings.cs index 09fa271..d97186d 100644 --- a/Core/Settings.cs +++ b/Core/Settings.cs @@ -763,6 +763,7 @@ namespace ScrewTurn.Wiki { /// The namespace (null for the root). /// The theme name. public static string GetTheme(string nspace) { + if(!string.IsNullOrEmpty(nspace)) nspace = Pages.FindNamespace(nspace).Name; string propertyName = "Theme" + (!string.IsNullOrEmpty(nspace) ? "-" + nspace : ""); return GetString(Provider.GetSetting(propertyName), "Default"); } @@ -773,6 +774,7 @@ namespace ScrewTurn.Wiki { /// The namespace (null for the root). /// The theme name. public static void SetTheme(string nspace, string theme) { + if(!string.IsNullOrEmpty(nspace)) nspace = Pages.FindNamespace(nspace).Name; string propertyName = "Theme" + (!string.IsNullOrEmpty(nspace) ? "-" + nspace : ""); Provider.SetSetting(propertyName, theme); } diff --git a/Core/UrlTools.cs b/Core/UrlTools.cs index 30e846a..194b715 100644 --- a/Core/UrlTools.cs +++ b/Core/UrlTools.cs @@ -31,9 +31,6 @@ namespace ScrewTurn.Wiki { string nspace = GetCurrentNamespace(); if(!string.IsNullOrEmpty(nspace)) pageName = pageName.Substring(nspace.Length + 1); // Trim Namespace. from pageName - //HttpContext.Current.Response.Filter = - // new ScrewTurn.Wiki.RelativeUrlFilterStream(HttpContext.Current.Response.Filter, nspace); - string queryString = ""; // Empty or begins with ampersand, not question mark try { // This might throw exceptions if 3rd-party modules interfer with the request pipeline @@ -53,7 +50,7 @@ namespace ScrewTurn.Wiki { else if(ext.Equals("aspx")) { // System page requested, redirect to the root of the application // For example: http://www.server.com/Namespace.Edit.aspx?Page=MainPage -> http://www.server.com/Edit.aspx?Page=MainPage&NS=Namespace - if(!string.IsNullOrEmpty(nspace)) { // Needed to avoid infinite loops + if(!string.IsNullOrEmpty(nspace)) { if(!queryString.Contains("NS=")) { HttpContext.Current.RewritePath("~/" + Tools.UrlEncode(pageName) + "." + ext + "?NS=" + Tools.UrlEncode(nspace) + queryString); } @@ -122,6 +119,7 @@ namespace ScrewTurn.Wiki { if(string.IsNullOrEmpty(nspace)) nspace = null; if(nspace == null) nspace = GetCurrentNamespace(); if(string.IsNullOrEmpty(nspace)) nspace = null; + else nspace = Pages.FindNamespace(nspace).Name; if(nspace != null) { string tempStringLower = tempString.ToLowerInvariant();