Merge pull request #2977 from thelounge/xpaw/setting-new

Add an extra check for setting names
This commit is contained in:
Pavel Djundik 2019-01-16 13:32:22 +02:00 committed by GitHub
commit 84ae91c525
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -494,6 +494,10 @@ function initializeClient(socket, client, token, lastMessage) {
return;
}
if (typeof newSetting.value === "object" || typeof newSetting.name !== "string" || newSetting.name[0] === "_") {
return;
}
// Older user configs will not have the clientSettings property.
if (!client.config.hasOwnProperty("clientSettings")) {
client.config.clientSettings = {};