diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index 923d95c..ccfb674 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.411")] -[assembly: AssemblyFileVersion("3.0.1.411")] +[assembly: AssemblyVersion("3.0.1.412")] +[assembly: AssemblyFileVersion("3.0.1.412")] diff --git a/Core/Tools.cs b/Core/Tools.cs index dbd9c9b..d40e822 100644 --- a/Core/Tools.cs +++ b/Core/Tools.cs @@ -317,7 +317,11 @@ namespace ScrewTurn.Wiki { /// The input string. /// The encoded string. public static string UrlEncode(string input) { - return HttpContext.Current.Server.UrlEncode(input).Replace("+", "%20"); + if(HttpContext.Current != null && HttpContext.Current.Server != null) return HttpContext.Current.Server.UrlEncode(input).Replace("+", "%20"); + else { + Log.LogEntry("HttpContext.Current or HttpContext.Current.Server were null (Tools.UrlEncode)", EntryType.Warning, Log.SystemUsername); + return input; + } } /// diff --git a/Core/UrlTools.cs b/Core/UrlTools.cs index 194b715..5b43882 100644 --- a/Core/UrlTools.cs +++ b/Core/UrlTools.cs @@ -28,7 +28,7 @@ namespace ScrewTurn.Wiki { if(ext != "ashx" && ext != "aspx") return; // Extract the current namespace, if any - string nspace = GetCurrentNamespace(); + string nspace = GetCurrentNamespace() + ""; if(!string.IsNullOrEmpty(nspace)) pageName = pageName.Substring(nspace.Length + 1); // Trim Namespace. from pageName string queryString = ""; // Empty or begins with ampersand, not question mark