summaryrefslogtreecommitdiff
path: root/lib/blog/delcom.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/blog/delcom.php')
-rw-r--r--lib/blog/delcom.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/blog/delcom.php b/lib/blog/delcom.php
new file mode 100644
index 0000000..eaf93ec
--- /dev/null
+++ b/lib/blog/delcom.php
@@ -0,0 +1,12 @@
+<?php
+
+assert_redir(count($args) >= 3, 'blog');
+$comid = intval($args[2]);
+
+$com = mysql_fetch_assoc(sql("SELECT post FROM blog_comments WHERE id = $comid"));
+assert_error($com,
+ "This comment does not exist.");
+
+token_validate("Do you really want to delete this comment ?", "view-blog-" . $com['post']);
+sql("DELETE FROM blog_comments WHERE id = $comid");
+header("Location: view-blog-" . $com['post']);