mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-12 15:04:52 +09:00
Sanitizing !shout chat
This commit is contained in:
1 parent
1bd87c4cc9
commit
e38aed08bf
2 files changed
+6
-4
No files matched your search
@@ -1017,7 +1017,7 @@ io.on('connection', function (socket) {
|
||||
prometheusWsUsageCounter.labels("registerAlertReciever").inc();
|
||||
if(!global.wsAlertRecievers) global.wsAlertRecievers = [];
|
||||
global.wsAlertRecievers.push(socket);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
module.exports = app;
|
||||
@@ -12,9 +12,11 @@ module.exports = class remoteCommands {
|
||||
message.shift();
|
||||
message.shift();
|
||||
message.shift();
|
||||
message.join(" ");
|
||||
let chatMessage = "["+data.instanceID+"]"+ message;
|
||||
this.messageInterface("/c game.print('"+chatMessage+"')");
|
||||
let chatMessage = "["+data.instanceID+"]"+ message.join(" ");
|
||||
while(chatMessage.includes("'")){
|
||||
chatMessage = chatMessage.replace("'", "");
|
||||
}
|
||||
this.messageInterface("/silent-command game.print('"+chatMessage.replace("!shout ","")+"')");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in new issue
Block a user