Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updates release/10.0.0 with latest fixes from develop #5847

Merged
merged 29 commits into from
Oct 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
be395c7
Closes #5811 CKE Provider host level settings not stored consistently
skamphuis Sep 13, 2023
a534e33
Closes #5812 by taking the block out of the if block
skamphuis Sep 13, 2023
7acdf13
#5811 CKE Provider setting constant
skamphuis Sep 13, 2023
98c5ee7
#5811 CKE accidentally changed version number
skamphuis Sep 13, 2023
e59b2de
Use InvariantCulture for portal ID
bdukes Sep 19, 2023
356ae81
No Warning for moniker not found, when moniker is empty
skamphuis Sep 21, 2023
e78fbe2
No Warning for moniker not found, when moniker is empty
skamphuis Sep 21, 2023
8509a7b
In DDRMenu.FilterNodes only do GetTab when tabId > 0
skamphuis Sep 21, 2023
f9c6d60
BasicUrlRewriter: no log after redirect
skamphuis Sep 21, 2023
db60164
Fix serialization errors when using external cache
skamphuis Sep 22, 2023
b9c4e38
HTML/Text: implement caching for GetWorkflows
skamphuis Sep 22, 2023
0e56f36
TabController: only clear cache when tab is for the current portal
skamphuis Sep 22, 2023
7bd3647
5819 requested changes
skamphuis Sep 25, 2023
dab6a5a
Update bug-report.yml
valadas Sep 27, 2023
25d997e
Merge pull request #5828 from dnnsoftware/valadas-patch-1
valadas Sep 27, 2023
8ec5ce0
Fix missing braces
bdukes Oct 4, 2023
d056edf
Removed extra blank line
valadas Oct 4, 2023
6d6cc02
Prevent control characters in username
GerardSmit Oct 9, 2023
00130de
Add email test
GerardSmit Oct 9, 2023
e0f01b5
Remove unnecessary space
GerardSmit Oct 9, 2023
db706ae
Replace new lines and tabs with a single space
GerardSmit Oct 9, 2023
1f4a0ef
Bump fsevents from 1.2.9 to 1.2.13
dependabot[bot] Oct 10, 2023
1b0d7f1
Merge pull request #5820 from skamphuis/feature/5819-Improvements-Log…
mitchelsellers Oct 10, 2023
e10f4c3
Merge pull request #5813 from skamphuis/feature/CKE-host-level-settings
mitchelsellers Oct 10, 2023
746470b
Merge pull request #5835 from GerardSmit/issue-5834
mitchelsellers Oct 10, 2023
7631f2c
Merge pull request #5836 from dnnsoftware/dependabot/npm_and_yarn/fse…
valadas Oct 10, 2023
df634b6
Merge pull request #5822 from skamphuis/feature/5819-Improvements-Cac…
valadas Oct 13, 2023
b99fe76
Fixed JavaScript error
GerardSmit Oct 13, 2023
39c25b7
Merge pull request #5845 from GerardSmit/issue-5818
valadas Oct 13, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/bug-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ body:
**NOTE:** _If your version is not listed, please upgrade to the latest version. If you cannot upgrade at this time, please open a [Discussion](https://github.com/dnnsoftware/Dnn.Platform/discussions) instead._
multiple: true
options:
- 9.12.0 (latest release)
- 9.13.0 (release candidate)
- 9.13.0 (latest release)
- 9.13.1 (alpha)
- 10.0.0 (alpha)
validations:
required: true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,14 +152,14 @@ private static int GetTabModuleInfoFromMoniker(string monikerValue)
if (ids != null && ids.Any())
{
return ids.First();
}

if (Logger.IsWarnEnabled)
{
Logger.WarnFormat("The specified moniker ({0}) is not defined in the system", monikerValue);
}
}

if (Logger.IsWarnEnabled)
{
Logger.WarnFormat("The specified moniker ({0}) is not defined in the system", monikerValue);
}

return Null.NullInteger;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,11 @@ private static int GetTabModuleInfoFromMoniker(string monikerValue)
{
return ids.First();
}
}

if (Logger.IsWarnEnabled)
{
Logger.WarnFormat("The specified moniker ({0}) is not defined in the system", monikerValue);
if (Logger.IsWarnEnabled)
{
Logger.WarnFormat("The specified moniker ({0}) is not defined in the system", monikerValue);
}
}

return Null.NullInteger;
Expand Down
3 changes: 1 addition & 2 deletions DNN Platform/HttpModules/UrlRewrite/BasicUrlRewriter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,9 @@ internal override void RewriteUrl(object sender, EventArgs e)
}
}
}
catch (ThreadAbortException exc)
catch (ThreadAbortException)
{
// Do nothing if Thread is being aborted - there are two response.redirect calls in the Try block
Logger.Debug(exc);
}
catch (Exception ex)
{
Expand Down
8 changes: 6 additions & 2 deletions DNN Platform/JavaScript Libraries/DnnPlugins/dnn.jquery.js
Original file line number Diff line number Diff line change
Expand Up @@ -4314,10 +4314,14 @@
});
};

function registerEvents() {
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(saveRgDataDivScrollTop);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(dnnInitCustomisedCtrls);
}

window.__rgDataDivScrollTopPersistArray = [];
$(document).ajaxComplete(dnnInitCustomisedCtrls);
Sys.WebForms.PageRequestManager.getInstance().add_beginRequest(saveRgDataDivScrollTop);
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(dnnInitCustomisedCtrls);
$(dnnInitCustomisedCtrls);
$(registerEvents);
handlerSendVerificationMailLink();
})(jQuery);
6 changes: 3 additions & 3 deletions DNN Platform/Library/Entities/Tabs/TabController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1394,9 +1394,9 @@ public TabInfo GetTab(int tabId, int portalId, bool ignoreCache)
// correctly, this may occurred when install is set up in web farm.
tab = CBO.FillObject<TabInfo>(this.dataProvider.GetTab(tabId));

// if tab is not null means that the cache doesn't update correctly, we need clear the cache
// and let it rebuild cache when request next time.
if (tab != null)
// if tab is not null, and it is for "portalId", that means that the cache doesn't update correctly,
// we need to clear the cache and let it rebuild cache when request next time.
if (tab != null && tab.PortalID == portalId)
{
this.ClearCache(tab.PortalID);
}
Expand Down
24 changes: 24 additions & 0 deletions DNN Platform/Library/Security/PortalSecurity.cs
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ public class PortalSecurity

private static readonly Regex StripTagsRegex = new Regex("<[^<>]*>", RegexOptions.IgnoreCase | RegexOptions.Singleline | RegexOptions.Compiled);
private static readonly Regex BadStatementRegex = new Regex(BadStatementExpression, RegexOptions.IgnoreCase | RegexOptions.Compiled);
private static readonly Regex ControlCharactersRegex = new Regex(@"\p{C}+", RegexOptions.Compiled);
private static readonly Regex ControlCharacterToWhitespaceRegex = new Regex(@"\r\n|\r|\n|\t", RegexOptions.Compiled);

private static readonly Regex[] RxListStrings = new[]
{
Expand Down Expand Up @@ -109,6 +111,14 @@ public enum FilterFlag
[Obsolete("Deprecated in DotNetNuke 9.8.1. Individual string replacement should be completed. Scheduled for removal in v11.0.0.")]
NoAngleBrackets = 16,
NoProfanity = 32,

/// <summary>
/// Removes all unicode control characters (like \0, \t, \n, \r, etc.) from the string.
/// </summary>
/// <remarks>
/// The control characters \r\n, \r, \n, and \t are replaced with a single space instead of being removed.
/// </remarks>
NoControlCharacters = 64,
}

/// <summary>Determines the configuration source for the remove and replace functions.</summary>
Expand Down Expand Up @@ -473,6 +483,11 @@ public string InputFilter(string userInput, FilterFlag filterType)
tempInput = this.Replace(tempInput, ConfigType.ListController, "ProfanityFilter", FilterScope.SystemAndPortalList);
}

if ((filterType & FilterFlag.NoControlCharacters) == FilterFlag.NoControlCharacters)
{
tempInput = FormatRemoveControlCharacters(tempInput);
}

return tempInput;
}

Expand Down Expand Up @@ -1018,6 +1033,15 @@ private static string FormatRemoveSQL(string strSQL)
return BadStatementRegex.Replace(strSQL, " ").Replace("'", "''");
}

/// <summary>This function removes control characters from the string.</summary>
/// <param name="str">This is the string to be filtered.</param>
/// <returns>Filtered UserInput.</returns>
/// <remarks>This is a private function that is used internally by the <see cref="InputFilter"/> function.</remarks>
private static string FormatRemoveControlCharacters(string str)
{
return ControlCharactersRegex.Replace(ControlCharacterToWhitespaceRegex.Replace(str, " "), string.Empty);
}

/// <summary>This function determines if the Input string contains any markup.</summary>
/// <param name="strInput">This is the string to be checked.</param>
/// <returns>True if string contains Markup tag(s).</returns>
Expand Down
6 changes: 6 additions & 0 deletions DNN Platform/Modules/DDRMenu/MenuBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,12 @@ private void FilterNodes(string nodeString, bool exclude)
this.RootNode.Children.FindAll(
n =>
{
// no need to check when the node is not a page
if (n.TabId <= 0)
{
return false;
}

var tab = TabController.Instance.GetTab(n.TabId, Null.NullInteger, false);
foreach (TabPermissionInfo perm in tab.TabPermissions)
{
Expand Down
19 changes: 17 additions & 2 deletions DNN Platform/Modules/HTML/Components/WorkflowStateController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,31 @@ namespace DotNetNuke.Modules.Html
public class WorkflowStateController
{
private const string WORKFLOWCACHEKEY = "Workflow{0}";
private const string WORKFLOWSCACHEKEY = "Workflows{0}";
private const int WORKFLOWCACHETIMEOUT = 20;

private const CacheItemPriority WORKFLOWCACHEPRIORITY = CacheItemPriority.Normal;

/// <summary>GetWorkFlows retrieves a collection of workflows for the portal.</summary>
/// <summary>GetWorkFlows retrieves a collection of workflows for the portal from the cache.</summary>
/// <param name="portalID">The ID of the Portal.</param>
/// <returns>An <see cref="ArrayList"/> of <see cref="WorkflowStateInfo"/> instances.</returns>
public ArrayList GetWorkflows(int portalID)
{
return CBO.FillCollection(DataProvider.Instance().GetWorkflows(portalID), typeof(WorkflowStateInfo));
var cacheKey = string.Format(WORKFLOWSCACHEKEY, portalID);
return CBO.GetCachedObject<ArrayList>(new CacheItemArgs(cacheKey, WORKFLOWCACHETIMEOUT, WORKFLOWCACHEPRIORITY, portalID), this.GetWorkflowsCallBack);
}

/// -----------------------------------------------------------------------------
/// <summary>
/// GetWorkflowsCallBack retrieves a collection of WorkflowStateInfo objects for the Portal from the database.
/// </summary>
/// <param name = "cacheItemArgs">Arguments passed by the GetWorkflowStates method.</param>
/// <returns>WorkflowStateInfo List.</returns>
/// -----------------------------------------------------------------------------
public ArrayList GetWorkflowsCallBack(CacheItemArgs cacheItemArgs)
{
var portalId = (int)cacheItemArgs.ParamList[0];
return CBO.FillCollection(DataProvider.Instance().GetWorkflows(portalId), typeof(WorkflowStateInfo));
}

/// <summary>GetWorkFlowStates retrieves a collection of WorkflowStateInfo objects for the Workflow from the cache.</summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -790,7 +790,7 @@ protected void Page_Load(object sender, EventArgs e)
this.portalSettings,
this.currentSettings,
settingsDictionary,
"DNNCKP#-1#",
SettingConstants.HostKey,
null);

switch (this.currentSettings.SettingMode)
Expand All @@ -808,15 +808,15 @@ protected void Page_Load(object sender, EventArgs e)
this.portalSettings,
this.currentSettings,
settingsDictionary,
"DNNCKH#",
SettingConstants.HostKey,
null);
break;
case SettingsMode.Portal:
this.currentSettings = SettingsUtil.LoadEditorSettingsByKey(
this.portalSettings,
this.currentSettings,
settingsDictionary,
$"DNNCKP#{this.request.QueryString["PortalID"]}#",
SettingConstants.PortalKey(this.request.QueryString["PortalID"]),
portalRoles);
break;
case SettingsMode.Page:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -192,15 +192,15 @@ private EditorProviderSettings GetCurrentSettings(HttpContext context)
this.portalSettings,
currentSettings,
settingsDictionary,
"DNNCKH#",
SettingConstants.HostKey,
portalRoles);
break;
case SettingsMode.Portal:
currentSettings = SettingsUtil.LoadEditorSettingsByKey(
this.portalSettings,
currentSettings,
settingsDictionary,
$"DNNCKP#{portalId}#",
SettingConstants.PortalKey(portalId),
portalRoles);
break;
case SettingsMode.Page:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -769,7 +769,7 @@ var codeMirrorInfo in
// get the all-sites settings to be able to to show overridden values
// when we're not in all-sites mode
var allPortalsSettings = SettingsUtil.LoadEditorSettingsByKey(
this.portalSettings, this.currentSettings, EditorController.GetEditorHostSettings(), "DNNCKP#-1#", new List<RoleInfo>());
this.portalSettings, this.currentSettings, EditorController.GetEditorHostSettings(), SettingConstants.HostKey, new List<RoleInfo>());

this.HostBrowserRootDir.ReadOnly = !this.IsHostMode || this.CurrentPortalOnly;
this.HostBrowserRootDir.Text = this.HostBrowserRootDir.ReadOnly ? allPortalsSettings.HostBrowserRootDir : importedSettings.HostBrowserRootDir;
Expand Down Expand Up @@ -1839,8 +1839,8 @@ private void LoadSettings(int currentMode, bool changeMode = true)
var settingsDictionary = EditorController.GetEditorHostSettings();
var portalRoles = RoleController.Instance.GetRoles(this.portalSettings?.PortalId ?? Host.HostPortalID);

var hostKey = "DNNCKH#";
var portalKey = $"DNNCKP#{this.portalSettings?.PortalId ?? Host.HostPortalID}#";
var hostKey = SettingConstants.HostKey;
var portalKey = SettingConstants.PortalKey(this.portalSettings?.PortalId ?? Host.HostPortalID);
var pageKey = $"DNNCKT#{this.CurrentOrSelectedTabId}#";
var moduleKey = $"DNNCKMI#{this.ModuleId}#INS#{this.moduleInstanceName}#";

Expand Down Expand Up @@ -2793,10 +2793,10 @@ private void SaveSettings()
switch (this.CurrentSettingsMode)
{
case SettingsMode.Host:
this.SaveSettingsByKey("DNNCKH#");
this.SaveSettingsByKey(SettingConstants.HostKey);
break;
case SettingsMode.Portal:
this.SaveSettingsByKey($"DNNCKP#{this.portalSettings?.PortalId ?? Host.HostPortalID}#");
this.SaveSettingsByKey(SettingConstants.PortalKey(this.portalSettings?.PortalId ?? Host.HostPortalID));
break;
case SettingsMode.Page:
this.SaveSettingsByKey($"DNNCKT#{this.CurrentOrSelectedTabId}#");
Expand Down Expand Up @@ -3287,6 +3287,7 @@ private EditorProviderSettings ExportSettings()
exportSettings.Config.Skin = this.ddlSkin.SelectedValue;
exportSettings.Config.CodeMirror.Theme = this.CodeMirrorTheme.SelectedValue;
exportSettings.Browser = this.ddlBrowser.SelectedValue;
exportSettings.BrowserAllowFollowFolderPerms = this.BrowAllowFollowPerms.Checked;
exportSettings.ImageButton = this.ddlImageButton.SelectedValue;
exportSettings.FileListViewMode =
(FileListView)Enum.Parse(typeof(FileListView), this.FileListViewMode.SelectedValue);
Expand Down
Loading
Loading