From 7f662b2b1a57dd5f3fd5250537ec19ad53405dc3 Mon Sep 17 00:00:00 2001 From: Mike Primm Date: Thu, 2 Jun 2011 15:15:46 -0500 Subject: [PATCH] Properly stringify chat input, so that we wind up with value JSON (doublequote, and others) --- web/js/chat.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/js/chat.js b/web/js/chat.js index 8e29bc00..3fca24e1 100644 --- a/web/js/chat.js +++ b/web/js/chat.js @@ -21,7 +21,7 @@ componentconstructors['chat'] = function(dynmap, configuration) { if (dynmap.options.allowwebchat) { // Accepts 'sendchat'-events to send chat messages to the server. $(dynmap).bind('sendchat', function(event, message) { - var data = '{"name":"'+ip+'","message":"'+message+'"}'; + var data = '{"name":'+JSON.stringify(ip)+',"message":'+JSON.stringify(message)+'}'; $.ajax({ type: 'POST', url: 'up/sendmessage',