mirror of
https://github.com/webbukkit/dynmap.git
synced 2025-01-13 03:10:39 +01:00
Merge pull request #193 from mikeprimm/master
Properly stringify chat inputs - prevents bad JSON input, potential security exposures
This commit is contained in:
commit
b2df79eb9c
@ -21,7 +21,7 @@ componentconstructors['chat'] = function(dynmap, configuration) {
|
|||||||
if (dynmap.options.allowwebchat) {
|
if (dynmap.options.allowwebchat) {
|
||||||
// Accepts 'sendchat'-events to send chat messages to the server.
|
// Accepts 'sendchat'-events to send chat messages to the server.
|
||||||
$(dynmap).bind('sendchat', function(event, message) {
|
$(dynmap).bind('sendchat', function(event, message) {
|
||||||
var data = '{"name":"'+ip+'","message":"'+message+'"}';
|
var data = '{"name":'+JSON.stringify(ip)+',"message":'+JSON.stringify(message)+'}';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: 'up/sendmessage',
|
url: 'up/sendmessage',
|
||||||
|
Loading…
Reference in New Issue
Block a user