Fixed issue with inter-namespace page redirection.
This commit is contained in:
parent
8c5febca3f
commit
7e203d3c3b
5 changed files with 20 additions and 7 deletions
|
@ -16,5 +16,5 @@ using System.Reflection;
|
||||||
//
|
//
|
||||||
// You can specify all the values or you can default the Revision and Build Numbers
|
// You can specify all the values or you can default the Revision and Build Numbers
|
||||||
// by using the '*' as shown below:
|
// by using the '*' as shown below:
|
||||||
[assembly: AssemblyVersion("3.0.1.401")]
|
[assembly: AssemblyVersion("3.0.1.402")]
|
||||||
[assembly: AssemblyFileVersion("3.0.1.401")]
|
[assembly: AssemblyFileVersion("3.0.1.402")]
|
||||||
|
|
|
@ -37,6 +37,7 @@ namespace ScrewTurn.Wiki {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void ClearPseudoCache() {
|
public static void ClearPseudoCache() {
|
||||||
Cache.ClearPseudoCache();
|
Cache.ClearPseudoCache();
|
||||||
|
Redirections.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -91,6 +92,7 @@ namespace ScrewTurn.Wiki {
|
||||||
/// <param name="pageInfo">The Page to invalidate the cached content of.</param>
|
/// <param name="pageInfo">The Page to invalidate the cached content of.</param>
|
||||||
public static void InvalidatePage(PageInfo pageInfo) {
|
public static void InvalidatePage(PageInfo pageInfo) {
|
||||||
Cache.RemovePage(pageInfo);
|
Cache.RemovePage(pageInfo);
|
||||||
|
Redirections.WipePageOut(pageInfo);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -98,6 +100,7 @@ namespace ScrewTurn.Wiki {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
public static void InvalidateAllPages() {
|
public static void InvalidateAllPages() {
|
||||||
Cache.ClearPageCache();
|
Cache.ClearPageCache();
|
||||||
|
Redirections.Clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -637,12 +637,13 @@ namespace ScrewTurn.Wiki {
|
||||||
sb.Replace("~~~~", "§§(" + username + "," + dateTime.ToString("yyyy'/'MM'/'dd' 'HH':'mm':'ss") + ")§§");
|
sb.Replace("~~~~", "§§(" + username + "," + dateTime.ToString("yyyy'/'MM'/'dd' 'HH':'mm':'ss") + ")§§");
|
||||||
content = sb.ToString();
|
content = sb.ToString();
|
||||||
|
|
||||||
bool done = page.Provider.ModifyPage(page, title, username, dateTime, comment, content, keywords, description, saveMode);
|
|
||||||
|
|
||||||
if(done) {
|
|
||||||
// Because of transclusion and other page-linking features, it is necessary to clear the whole cache
|
// Because of transclusion and other page-linking features, it is necessary to clear the whole cache
|
||||||
Content.ClearPseudoCache();
|
Content.ClearPseudoCache();
|
||||||
Content.InvalidateAllPages();
|
Content.InvalidateAllPages();
|
||||||
|
|
||||||
|
bool done = page.Provider.ModifyPage(page, title, username, dateTime, comment, content, keywords, description, saveMode);
|
||||||
|
|
||||||
|
if(done) {
|
||||||
Log.LogEntry("Page Content updated for " + page.FullName, EntryType.General, Log.SystemUsername);
|
Log.LogEntry("Page Content updated for " + page.FullName, EntryType.General, Log.SystemUsername);
|
||||||
|
|
||||||
StorePageOutgoingLinks(page, content);
|
StorePageOutgoingLinks(page, content);
|
||||||
|
|
|
@ -86,8 +86,17 @@ namespace ScrewTurn.Wiki {
|
||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="target">The target URL.</param>
|
/// <param name="target">The target URL.</param>
|
||||||
public static void Redirect(string target) {
|
public static void Redirect(string target) {
|
||||||
|
Redirect(target, true);
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Redirects the current response to the specified URL, appending the current namespace if requested.
|
||||||
|
/// </summary>
|
||||||
|
/// <param name="target">The target URL.</param>
|
||||||
|
/// <param name="addNamespace">A value indicating whether to add the namespace.</param>
|
||||||
|
public static void Redirect(string target, bool addNamespace) {
|
||||||
string nspace = HttpContext.Current.Request["NS"];
|
string nspace = HttpContext.Current.Request["NS"];
|
||||||
if(nspace == null || nspace.Length == 0) HttpContext.Current.Response.Redirect(target);
|
if(nspace == null || nspace.Length == 0 || !addNamespace) HttpContext.Current.Response.Redirect(target);
|
||||||
else HttpContext.Current.Response.Redirect(target + (target.Contains("?") ? "&" : "?") + "NS=" + Tools.UrlEncode(nspace));
|
else HttpContext.Current.Response.Redirect(target + (target.Contains("?") ? "&" : "?") + "NS=" + Tools.UrlEncode(nspace));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -351,7 +351,7 @@ namespace ScrewTurn.Wiki {
|
||||||
|
|
||||||
if(dest != null) {
|
if(dest != null) {
|
||||||
if(Request["NoRedirect"] != "1") {
|
if(Request["NoRedirect"] != "1") {
|
||||||
UrlTools.Redirect(dest.FullName + Settings.PageExtension + "?From=" + currentPage.FullName);
|
UrlTools.Redirect(dest.FullName + Settings.PageExtension + "?From=" + currentPage.FullName, false);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
// Write redirection hint
|
// Write redirection hint
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue