File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ func (s *KeyService) ParseKeysFromText(text string) []string {
168168 }
169169
170170 // 通用解析:通过分隔符分割文本,不使用复杂的正则表达式
171- delimiters := regexp .MustCompile (`[\s,;| \n\r\t]+` )
171+ delimiters := regexp .MustCompile (`[\s,;\n\r\t]+` )
172172 splitKeys := delimiters .Split (strings .TrimSpace (text ), - 1 )
173173
174174 for _ , key := range splitKeys {
@@ -195,13 +195,7 @@ func (s *KeyService) filterValidKeys(keys []string) []string {
195195
196196// isValidKeyFormat performs basic validation on key format
197197func (s * KeyService ) isValidKeyFormat (key string ) bool {
198- if key == "" ||
199- strings .TrimSpace (key ) == "" {
200- return false
201- }
202-
203- validChars := regexp .MustCompile (`^[a-zA-Z0-9_\-./+=:]+$` )
204- return validChars .MatchString (key )
198+ return strings .TrimSpace (key ) != ""
205199}
206200
207201// RestoreMultipleKeys handles the business logic of restoring keys from a text block.
You can’t perform that action at this time.
0 commit comments