aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xweb/nms.gathering.org/api/private/comment-change10
-rw-r--r--web/nms.gathering.org/js/nms.js1
2 files changed, 8 insertions, 3 deletions
diff --git a/web/nms.gathering.org/api/private/comment-change b/web/nms.gathering.org/api/private/comment-change
index ccf336d..fb7da54 100755
--- a/web/nms.gathering.org/api/private/comment-change
+++ b/web/nms.gathering.org/api/private/comment-change
@@ -3,12 +3,16 @@
use lib '../../../../include';
use utf8;
use nms;
-use nms::web;
+use nms::web qw($dbh db_safe_quote get_input finalize_output);
+
use strict;
use warnings;
-my $id = db_safe_quote('comment');
-my $state = db_safe_quote('state');
+my $in = get_input();
+my %tmp = %{JSON::XS::decode_json($in)};
+
+my $id = $dbh->quote($tmp{'comment'});
+my $state = $dbh->quote($tmp{'state'});
my $q = $nms::web::dbh->prepare("UPDATE switch_comments SET state = " . $state . " WHERE id = " . $id . ";");
$q->execute();
diff --git a/web/nms.gathering.org/js/nms.js b/web/nms.gathering.org/js/nms.js
index a959db0..9bf4196 100644
--- a/web/nms.gathering.org/js/nms.js
+++ b/web/nms.gathering.org/js/nms.js
@@ -491,6 +491,7 @@ function commentChange(id,state)
comment:id,
state:state
};
+ myData = JSON.stringify(myData);
var foo = document.getElementById("commentRow" + id);
if (foo) {
foo.className = '';