mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-21 08:03:13 +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();
|
prometheusWsUsageCounter.labels("registerAlertReciever").inc();
|
||||||
if(!global.wsAlertRecievers) global.wsAlertRecievers = [];
|
if(!global.wsAlertRecievers) global.wsAlertRecievers = [];
|
||||||
global.wsAlertRecievers.push(socket);
|
global.wsAlertRecievers.push(socket);
|
||||||
}
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
module.exports = app;
|
module.exports = app;
|
||||||
@@ -12,9 +12,11 @@ module.exports = class remoteCommands {
|
|||||||
message.shift();
|
message.shift();
|
||||||
message.shift();
|
message.shift();
|
||||||
message.shift();
|
message.shift();
|
||||||
message.join(" ");
|
let chatMessage = "["+data.instanceID+"]"+ message.join(" ");
|
||||||
let chatMessage = "["+data.instanceID+"]"+ message;
|
while(chatMessage.includes("'")){
|
||||||
this.messageInterface("/c game.print('"+chatMessage+"')");
|
chatMessage = chatMessage.replace("'", "");
|
||||||
|
}
|
||||||
|
this.messageInterface("/silent-command game.print('"+chatMessage.replace("!shout ","")+"')");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user