don't try to post a comment without input
This commit is contained in:
parent
bf0ef6ce05
commit
54e3eef69c
@ -74,6 +74,7 @@ class CommentList implements Extension {
|
|||||||
|
|
||||||
if(($event instanceof PageRequestEvent) && $event->page_matches("comment")) {
|
if(($event instanceof PageRequestEvent) && $event->page_matches("comment")) {
|
||||||
if($event->get_arg(0) == "add") {
|
if($event->get_arg(0) == "add") {
|
||||||
|
if(isset($_POST['image_id']) && isset($_POST['comment'])) {
|
||||||
try {
|
try {
|
||||||
$cpe = new CommentPostingEvent($_POST['image_id'], $event->user, $_POST['comment']);
|
$cpe = new CommentPostingEvent($_POST['image_id'], $event->user, $_POST['comment']);
|
||||||
send_event($cpe);
|
send_event($cpe);
|
||||||
@ -84,6 +85,7 @@ class CommentList implements Extension {
|
|||||||
$this->theme->display_error($event->page, "Comment Blocked", $ex->getMessage());
|
$this->theme->display_error($event->page, "Comment Blocked", $ex->getMessage());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
else if($event->get_arg(0) == "delete") {
|
else if($event->get_arg(0) == "delete") {
|
||||||
if($event->user->is_admin()) {
|
if($event->user->is_admin()) {
|
||||||
// FIXME: post, not args
|
// FIXME: post, not args
|
||||||
|
Loading…
x
Reference in New Issue
Block a user