diff --git a/.github/ISSUE_TEMPLATE/bug1.yml b/.github/ISSUE_TEMPLATE/bug1.yml index 6a1f6993..68cd2bae 100644 --- a/.github/ISSUE_TEMPLATE/bug1.yml +++ b/.github/ISSUE_TEMPLATE/bug1.yml @@ -1,6 +1,6 @@ name: "Minecraft 崩溃" description: "PCL 提示 “Minecraft 出现错误”,或游戏崩溃" -labels: [· Bug, 新反馈] +labels: [· Bug, 新提交] body: - type: checkboxes id: "yml-1" diff --git a/.github/ISSUE_TEMPLATE/bug2.yml b/.github/ISSUE_TEMPLATE/bug2.yml index b2db13b4..de636f07 100644 --- a/.github/ISSUE_TEMPLATE/bug2.yml +++ b/.github/ISSUE_TEMPLATE/bug2.yml @@ -1,6 +1,6 @@ name: "下载或登录时卡住或失败" description: "下载游戏、Mod 或整合包,或登录正版账号时出现问题" -labels: [· Bug, 新反馈] +labels: [· Bug, 新提交] body: - type: checkboxes id: "yml-1" diff --git a/.github/ISSUE_TEMPLATE/bug9.yml b/.github/ISSUE_TEMPLATE/bug9.yml index 124b0c7a..be20097d 100644 --- a/.github/ISSUE_TEMPLATE/bug9.yml +++ b/.github/ISSUE_TEMPLATE/bug9.yml @@ -1,6 +1,6 @@ name: "综合 Bug 反馈" description: "遇见了没有细分选项的其他 Bug" -labels: [· Bug, 新反馈] +labels: [· Bug, 新提交] body: - type: checkboxes id: "yml-1" diff --git a/.github/ISSUE_TEMPLATE/ch.yml b/.github/ISSUE_TEMPLATE/ch.yml index 77ed3fda..0ddd6930 100644 --- a/.github/ISSUE_TEMPLATE/ch.yml +++ b/.github/ISSUE_TEMPLATE/ch.yml @@ -1,6 +1,6 @@ name: "优化建议" description: "对已有功能的小幅度优化或改进建议" -labels: [· 优化, 新反馈] +labels: [· 优化, 新提交] body: - type: checkboxes id: "yml-1" diff --git a/.github/ISSUE_TEMPLATE/feature.yml b/.github/ISSUE_TEMPLATE/feature.yml index e799ee42..e27452b5 100644 --- a/.github/ISSUE_TEMPLATE/feature.yml +++ b/.github/ISSUE_TEMPLATE/feature.yml @@ -1,6 +1,6 @@ name: "新功能提案" description: "对已有功能的大幅度修改,或添加一个新内容或选项" -labels: [· 新功能, 新反馈] +labels: [· 新功能, 新提交] body: - type: checkboxes id: "yml-1" diff --git a/Plain Craft Launcher 2/Modules/Base/ModBase.vb b/Plain Craft Launcher 2/Modules/Base/ModBase.vb index 5f65c581..ca5aab48 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModBase.vb +++ b/Plain Craft Launcher 2/Modules/Base/ModBase.vb @@ -1721,6 +1721,16 @@ RetryDir: Public Function RegexReplaceEach(Input As String, Replacement As MatchEvaluator, Regex As String, Optional options As RegexOptions = RegularExpressions.RegexOptions.None) As String Return RegularExpressions.Regex.Replace(Input, Regex, Replacement, options) End Function + ''' + ''' 检查传入字符串会不会引发 Issue #4505 + ''' + Public Function Ntfs83NameCheck(name As String) As Boolean + Dim regex As New Regex("(.*)~(\d*)") + Dim namePart As Byte() = Encoding.UTF8.GetBytes(regex.Match(name).Groups(1).Value) + Dim numPart As Integer = regex.Match(name).Groups(2).Value.Length + + Return namePart.Length >= 6 AndAlso numPart = 1 + End Function #End Region diff --git a/Plain Craft Launcher 2/Modules/Base/ModValidate.vb b/Plain Craft Launcher 2/Modules/Base/ModValidate.vb index b7f818b4..0321004b 100644 --- a/Plain Craft Launcher 2/Modules/Base/ModValidate.vb +++ b/Plain Craft Launcher 2/Modules/Base/ModValidate.vb @@ -233,6 +233,8 @@ Public Class ValidateFolderName '检查特殊字符串 Dim InvalidStrCheck As String = New ValidateExceptSame({"CON", "PRN", "AUX", "CLOCK$", "NUL", "COM0", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT0", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}, "文件夹名不可为 %!", True).Validate(Str) If Not InvalidStrCheck = "" Then Return InvalidStrCheck + '检查 NTFS 8.3 (issue #4505) + If Ntfs83NameCheck(Str) Then Return "文件夹名不能是一个有效的 NTFS 8.3 文件名!" '检查文件夹重名 Dim Arr As New List(Of String) If PathIgnore IsNot Nothing Then @@ -286,6 +288,8 @@ Public Class ValidateFileName '检查特殊字符串 Dim InvalidStrCheck As String = New ValidateExceptSame({"CON", "PRN", "AUX", "CLOCK$", "NUL", "COM0", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT0", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}, "文件名不可为 %!", True).Validate(Str) If Not InvalidStrCheck = "" Then Return InvalidStrCheck + '检查 NTFS 8.3 (issue #4505) + If Ntfs83NameCheck(Str) Then Return "文件名不能是一个有效的 NTFS 8.3 文件名!" '检查文件重名 If ParentFolder IsNot Nothing Then Dim DirInfo As New DirectoryInfo(ParentFolder) @@ -351,7 +355,9 @@ Fin: '检查特殊字符串 Dim InvalidStrCheck As String = New ValidateExceptSame({"CON", "PRN", "AUX", "CLOCK$", "NUL", "COM0", "COM1", "COM2", "COM3", "COM4", "COM5", "COM6", "COM7", "COM8", "COM9", "LPT0", "LPT1", "LPT2", "LPT3", "LPT4", "LPT5", "LPT6", "LPT7", "LPT8", "LPT9"}, "文件夹名不可为 %!").Validate(SubStr) If Not InvalidStrCheck = "" Then Return InvalidStrCheck + '检查 NTFS 8.3 (issue #4505) + If Ntfs83NameCheck(Str) Then Return "文件夹名不能是一个有效的 NTFS 8.3 文件名!" Next Return "" End Function -End Class +End Class \ No newline at end of file