aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/api/private/comment-change
diff options
context:
space:
mode:
Diffstat (limited to 'web/nms.gathering.org/api/private/comment-change')
-rwxr-xr-xweb/nms.gathering.org/api/private/comment-change10
1 files changed, 7 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();