From 00e89e86da0a7fdb92716ac546d780ec19dac5e6 Mon Sep 17 00:00:00 2001 From: rendyu <5318486+rendyu@users.noreply.github.com> Date: Thu, 27 Aug 2026 11:53:00 +0800 Subject: [PATCH 1/2] Add parsing for LastModifiedDate in StlChannel --- src/SSCMS.Core/StlParser/StlElement/StlChannel.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/SSCMS.Core/StlParser/StlElement/StlChannel.cs b/src/SSCMS.Core/StlParser/StlElement/StlChannel.cs index b2bef3acb..a04c40981 100644 --- a/src/SSCMS.Core/StlParser/StlElement/StlChannel.cs +++ b/src/SSCMS.Core/StlParser/StlElement/StlChannel.cs @@ -371,6 +371,11 @@ private static async Task ParseAsync(IParseManager parseManager, string inputType = InputType.DateTime; parsedContent = DateUtils.Format(channel.AddDate, format); } + else if (StringUtils.EqualsIgnoreCase(type, nameof(Channel.LastModifiedDate))) + { + inputType = InputType.DateTime; + parsedContent = DateUtils.Format(channel.LastModifiedDate, format); + } else if (StringUtils.EqualsIgnoreCase(type, nameof(Channel.ImageUrl))) { //inputType = InputType.Image; From c7c7d0443c698a702b9f3561147bf216d71f48cf Mon Sep 17 00:00:00 2001 From: rendyu <5318486+rendyu@users.noreply.github.com> Date: Thu, 27 Aug 2026 11:54:52 +0800 Subject: [PATCH 2/2] Fix null check for parentIdStrList access MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 原代码在获取父级频道ID时未判断 topLevel 是否小于 parentIdStrList.Count,可能导致越界异常。现已增加判断,确保安全访问列表元素。 --- src/SSCMS.Core/StlParser/Utility/StlDataManager.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SSCMS.Core/StlParser/Utility/StlDataManager.cs b/src/SSCMS.Core/StlParser/Utility/StlDataManager.cs index 942b52050..e4308b8d9 100644 --- a/src/SSCMS.Core/StlParser/Utility/StlDataManager.cs +++ b/src/SSCMS.Core/StlParser/Utility/StlDataManager.cs @@ -56,7 +56,7 @@ public async Task GetChannelIdByLevelAsync(int siteId, int channelId, int u if (topLevel < channel.ParentsCount) { var parentIdStrList = ListUtils.GetStringList(ListUtils.ToString(channel.ParentsPath)); - if (parentIdStrList[topLevel] != null) + if (topLevel < parentIdStrList.Count && parentIdStrList[topLevel] != null) { var parentIdStr = parentIdStrList[topLevel]; theChannelId = TranslateUtils.ToInt(parentIdStr);