mirror of
https://github.com/webbukkit/dynmap.git
synced 2024-06-23 21:24:55 +02:00
Prevent broken JSON when http://jsonip.appspot.com/ is over quote or
broken.
This commit is contained in:
parent
a827843365
commit
f802c1d889
|
@ -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":'+JSON.stringify(ip)+',"message":'+JSON.stringify(message)+'}';
|
var data = '{"name":'+JSON.stringify(ip?ip:"")+',"message":'+JSON.stringify(message)+'}';
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: 'POST',
|
type: 'POST',
|
||||||
url: config.url.sendmessage,
|
url: config.url.sendmessage,
|
||||||
|
|
Loading…
Reference in New Issue
Block a user