From 69a993c5af83fa8cbe05f0d3e0af1b8911198ee6 Mon Sep 17 00:00:00 2001 From: Marcin Kurczewski Date: Sun, 17 Nov 2013 14:16:52 +0100 Subject: [PATCH] Fixed sending empty comments --- src/Controllers/CommentController.php | 5 +++-- src/Views/post-view.phtml | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/Controllers/CommentController.php b/src/Controllers/CommentController.php index 43a1b54d..a6436118 100644 --- a/src/Controllers/CommentController.php +++ b/src/Controllers/CommentController.php @@ -50,10 +50,11 @@ class CommentController $post = Model_Post::locate($postId); - $text = InputHelper::get('text'); - if (!empty($text)) + if (InputHelper::get('submit')) { + $text = InputHelper::get('text'); $text = Model_Comment::validateText($text); + $comment = R::dispense('comment'); $comment->post = $post; if ($this->context->loggedIn) diff --git a/src/Views/post-view.phtml b/src/Views/post-view.phtml index b5f33d6f..29c03c49 100644 --- a/src/Views/post-view.phtml +++ b/src/Views/post-view.phtml @@ -307,6 +307,8 @@
+ +