diff --git a/AssemblyVersion.cs b/AssemblyVersion.cs index c240036..3d9c115 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.2.534")] -[assembly: AssemblyFileVersion("3.0.2.534")] +[assembly: AssemblyVersion("3.0.2.535")] +[assembly: AssemblyFileVersion("3.0.2.535")] diff --git a/Core/Formatter.cs b/Core/Formatter.cs index f052dea..39b577e 100644 --- a/Core/Formatter.cs +++ b/Core/Formatter.cs @@ -2470,20 +2470,27 @@ namespace ScrewTurn.Wiki { pageName = NameTools.GetFullName(currentNamespace, pageName); } } - PageInfo info = Pages.FindPage(pageName); + PageInfo transcludedPage = Pages.FindPage(pageName); - if(info != null && (current != null && info.FullName != current.FullName)) { // Avoid circular transclusion! + // Avoid circular transclusion + bool transclusionAllowed = + transcludedPage != null && + (current != null && + transcludedPage.FullName != current.FullName || + context != FormattingContext.PageContent && context != FormattingContext.TranscludedPageContent); + + if(transclusionAllowed) { string currentUsername = SessionFacade.GetCurrentUsername(); string[] currentGroups = SessionFacade.GetCurrentGroupNames(); - bool canView = AuthChecker.CheckActionForPage(info, Actions.ForPages.ReadPage, currentUsername, currentGroups); + bool canView = AuthChecker.CheckActionForPage(transcludedPage, Actions.ForPages.ReadPage, currentUsername, currentGroups); if(canView) { dummy = new StringBuilder(); dummy.Append(@"