Fixed #498: inexistent namespace correctly handled.

This commit is contained in:
Dario Solera 2010-02-28 10:49:59 +00:00
parent 0ac4be8bb0
commit c7a05066d3
2 changed files with 8 additions and 3 deletions

View file

@ -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.2.505")]
[assembly: AssemblyFileVersion("3.0.2.505")]
[assembly: AssemblyVersion("3.0.2.506")]
[assembly: AssemblyFileVersion("3.0.2.506")]

View file

@ -41,7 +41,12 @@ namespace ScrewTurn.Wiki {
// Extract the current namespace, if any
string nspace = GetCurrentNamespace() + "";
if(!string.IsNullOrEmpty(nspace)) pageName = pageName.Substring(nspace.Length + 1); // Trim Namespace. from pageName
if(!string.IsNullOrEmpty(nspace)) {
// Verify that namespace exists
if(Pages.FindNamespace(nspace) == null) HttpContext.Current.Response.Redirect("~/PageNotFound.aspx?Page=" + pageName);
}
// Trim Namespace. from pageName
if(!string.IsNullOrEmpty(nspace)) pageName = pageName.Substring(nspace.Length + 1);
string queryString = ""; // Empty or begins with ampersand, not question mark
try {