don't try to post a comment without input

This commit is contained in:
Shish 2009-01-24 00:15:33 -08:00
parent bf0ef6ce05
commit 54e3eef69c

View file

@ -74,6 +74,7 @@ class CommentList implements Extension {
if(($event instanceof PageRequestEvent) && $event->page_matches("comment")) {
if($event->get_arg(0) == "add") {
if(isset($_POST['image_id']) && isset($_POST['comment'])) {
try {
$cpe = new CommentPostingEvent($_POST['image_id'], $event->user, $_POST['comment']);
send_event($cpe);
@ -84,6 +85,7 @@ class CommentList implements Extension {
$this->theme->display_error($event->page, "Comment Blocked", $ex->getMessage());
}
}
}
else if($event->get_arg(0) == "delete") {
if($event->user->is_admin()) {
// FIXME: post, not args