diff options
author | Kristian Lyngstol <kly@kly.no> | 2016-03-13 01:13:53 +0000 |
---|---|---|
committer | Kristian Lyngstol <kly@kly.no> | 2016-03-13 01:13:53 +0000 |
commit | d1bb2ca6fced92b2d592e195126a3b28b73907b9 (patch) | |
tree | 92a165b1a6be3975953e75b58a76ae62d8dc34e6 /web/nms.gathering.org/api | |
parent | 7ac403641bca2ef24573e3c750ba801dd9b278e1 (diff) |
NMS: Fix comment changing
Diffstat (limited to 'web/nms.gathering.org/api')
-rwxr-xr-x | web/nms.gathering.org/api/private/comment-change | 10 |
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(); |