summaryrefslogtreecommitdiff
path: root/modules/comment/comment.module
diff options
context:
space:
mode:
authorwebchick <webchick@24967.no-reply.drupal.org>2011-06-29 23:51:36 -0700
committerwebchick <webchick@24967.no-reply.drupal.org>2011-06-29 23:51:36 -0700
commit0f9c1354d1077e5d13dc57090de802b00b0adbe4 (patch)
tree9904407fededecd2b729fb3c8b6f2920a3e0ac65 /modules/comment/comment.module
parentc40fde088c95cb6d44767b1b1a23f57f21894f63 (diff)
downloadbrdo-0f9c1354d1077e5d13dc57090de802b00b0adbe4.tar.gz
brdo-0f9c1354d1077e5d13dc57090de802b00b0adbe4.tar.bz2
Issue #813052 by lyricnz, droplet, dinknaround: Fixed Undefined index: format in comment_preview() line 2065 and line 2183.
Diffstat (limited to 'modules/comment/comment.module')
-rw-r--r--modules/comment/comment.module9
1 files changed, 8 insertions, 1 deletions
diff --git a/modules/comment/comment.module b/modules/comment/comment.module
index 8d0c3d362..393318a21 100644
--- a/modules/comment/comment.module
+++ b/modules/comment/comment.module
@@ -2161,7 +2161,14 @@ function comment_submit($comment) {
// 1) Filter it into HTML
// 2) Strip out all HTML tags
// 3) Convert entities back to plain-text.
- $comment->subject = truncate_utf8(trim(decode_entities(strip_tags(check_markup($comment->comment_body[LANGUAGE_NONE][0]['value'], $comment->comment_body[LANGUAGE_NONE][0]['format'])))), 29, TRUE);
+ $comment_body = $comment->comment_body[LANGUAGE_NONE][0];
+ if (isset($comment_body['format'])) {
+ $comment_text = check_markup($comment_body['value'], $comment_body['format']);
+ }
+ else {
+ $comment_text = check_plain($comment_body['value']);
+ }
+ $comment->subject = truncate_utf8(trim(decode_entities(strip_tags($comment_text))), 29, TRUE);
// Edge cases where the comment body is populated only by HTML tags will
// require a default subject.
if ($comment->subject == '') {