mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-05-20 12:40:16 +09:00
Security Update
[+] Protect Prototype
This commit is contained in:
parent
5e23ad2db1
commit
22a6819f7b
@ -1,6 +1,10 @@
|
|||||||
export function merge(target: any, source: any) {
|
export function merge(target: any, source: any) {
|
||||||
Object.keys(source).forEach(function (key) {
|
Object.keys(source).forEach(function (key) {
|
||||||
if (source[key] && typeof source[key] === "object") {
|
if (
|
||||||
|
source.hasOwnProperty(key) && // Check if the property is not inherited
|
||||||
|
source[key] &&
|
||||||
|
typeof source[key] === "object" || key === "__proto__" || key === "constructor"
|
||||||
|
) {
|
||||||
merge((target[key] = target[key] || {}), source[key]);
|
merge((target[key] = target[key] || {}), source[key]);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user