* 清理和规范化输入 * @param {string} text * @returns {string}
(text)
| 249 | * @returns {string} |
| 250 | */ |
| 251 | static sanitizeInput(text) { |
| 252 | if (!text) return ''; |
| 253 | return text |
| 254 | .replace(/[\x00-\x08\x0B\x0C\x0E-\x1F\x7F]/g, '') // 移除控制字符 |
| 255 | .trim(); |
| 256 | } |
| 257 | } |
| 258 | |
| 259 | /** |