summaryrefslogtreecommitdiff
path: root/modules/comment.module
diff options
context:
space:
mode:
Diffstat (limited to 'modules/comment.module')
-rw-r--r--modules/comment.module6
1 files changed, 4 insertions, 2 deletions
diff --git a/modules/comment.module b/modules/comment.module
index 01f732a62..3ef7b6504 100644
--- a/modules/comment.module
+++ b/modules/comment.module
@@ -546,8 +546,10 @@ function comment_preview($edit) {
}
$comment->timestamp = $edit['timestamp'] ? $edit['timestamp'] : time();
- // Preview the comment.
- $output .= theme('comment_view', $comment);
+ // Preview the comment with security check.
+ if (!form_get_errors()) {
+ $output .= theme('comment_view', $comment);
+ }
$output .= theme('comment_form', $edit, t('Reply'));
if ($edit['pid']) {