Fixed sending empty comments
This commit is contained in:
parent
7b473ba06f
commit
69a993c5af
2 changed files with 5 additions and 2 deletions
|
@ -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)
|
||||
|
|
|
@ -307,6 +307,8 @@
|
|||
<div class="input-wrapper"><textarea name="text" cols="50" rows="3"></textarea></div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="submit" value="1"/>
|
||||
|
||||
<div>
|
||||
<button name="sender" type="submit" value="preview">Preview</button>
|
||||
<button name="sender" type="submit" value="submit">Submit</button>
|
||||
|
|
Loading…
Reference in a new issue