don't try to post a comment without input
This commit is contained in:
parent
bf0ef6ce05
commit
54e3eef69c
1 changed files with 10 additions and 8 deletions
|
@ -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
|
||||
|
|
Reference in a new issue