mirror of
https://github.com/ikechan8370/chatgpt-plugin.git
synced 2025-12-17 22:07:10 +00:00
fix: vulnerability problems
This commit is contained in:
parent
b5afe1f4fb
commit
6da40e3843
7 changed files with 42 additions and 19 deletions
|
|
@ -6,6 +6,17 @@
|
|||
// .processSync(markdown ?? '')
|
||||
// .toString()
|
||||
// }
|
||||
export function escapeHtml (str) {
|
||||
const htmlEntities = {
|
||||
'&': '&',
|
||||
'<': '<',
|
||||
'>': '>',
|
||||
'"': '"',
|
||||
"'": ''',
|
||||
'/': '/'
|
||||
}
|
||||
return str.replace(/[&<>"'/]/g, (match) => htmlEntities[match])
|
||||
}
|
||||
|
||||
export async function upsertMessage (message) {
|
||||
await redis.set(`CHATGPT:MESSAGE:${message.id}`, JSON.stringify(message))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue