🐛 修复文件名包含反引号时变成undefined的问题
- 从sanitizeInput正则表达式中移除反引号 - 之前map中没有反引号映射导致返回undefined 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -198,9 +198,9 @@ app.use((req, res, next) => {
|
||||
function sanitizeInput(str) {
|
||||
if (typeof str !== 'string') return str;
|
||||
|
||||
// 1. 基础HTML实体转义(不包括 / 因为是路径分隔符)
|
||||
// 1. 基础HTML实体转义(不包括 / 因为是路径分隔符,不包括 ` 因为是合法文件名字符)
|
||||
let sanitized = str
|
||||
.replace(/[&<>"'`]/g, (char) => {
|
||||
.replace(/[&<>"']/g, (char) => {
|
||||
const map = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
|
||||
Reference in New Issue
Block a user