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

@ -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 {