Hk-Gosuto / ChatGPT-Next-Web-LangChain

一键拥有你自己的 ChatGPT 网页服务。 One-Click to deploy your own ChatGPT web UI.(基于 langchain 实现的插件版本 Plugin version implemented based on langchain)
https://n3xt.chat
MIT License
1.15k stars 383 forks source link

[Bug] 搜索框输入 `[` 导致页面崩溃 #319

Closed SuiYunsy closed 1 week ago

SuiYunsy commented 1 week ago

📦 Deployment Method

Official installation package

📌 Version

n3xt.chat

💻 Operating System

Windows

📌 System Version

Win10

🌐 Browser

Edge

📌 Browser Version

130

🐛 Bug Description

聊天记录中含有特殊字段时,输入框中输入 [ 会导致页面崩溃。

image

📷 Recurrence Steps

使用 https://n3xt.chat 可以复现:

首先确保聊天记录中含有这样一段话:访问密码不正确或为空,请前往[登录](/#/auth)页输入正确的访问密码,或者在[设置](/#/settings)页填入你自己的 OpenAI API Key。

或者简短一点:请前往[登录](/#/auth)页,或者在[设置](/#/settings)页

然后在左栏搜索聊天框里输入 [ 符号,就会触发页面崩溃。

image

🚦 Expected Behavior

No response

📝 Additional Information

No response

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Title: [Bug] Entering [ in the search box causes the page to crash

SuiYunsy commented 1 week ago

目前测试,如果聊天记录中有 [*+?()\ 并且搜索框里输入其中一个,就会报错。 遂让AI修复了一下,貌似没问题了😀

image

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


Currently testing, if there is [*+?()\ in the chat history and one of them is entered in the search box, an error will be reported. Then I asked AI to fix it, and it seemed to be fine😀

image

Hk-Gosuto commented 1 week ago

使用了差不多的方案,对特殊字符作了转义。

Issues-translate-bot commented 1 week ago

Bot detected the issue body's language is not English, translate it automatically.


A similar solution is used, with special characters escaped.