Index: modules/comment.module
===================================================================
RCS file: /cvs/drupal/drupal/modules/Attic/comment.module,v
retrieving revision 1.455.2.10
diff -u -r1.455.2.10 comment.module
--- modules/comment.module	18 Oct 2006 20:14:42 -0000	1.455.2.10
+++ modules/comment.module	1 Nov 2006 14:59:14 -0000
@@ -1434,9 +1434,15 @@
     // 1) Filter it into HTML
     // 2) Strip out all HTML tags
     // 3) Convert entities back to plain-text.
-  // Note: format is checked by check_markup().
-    $form_values['subject'] = truncate_utf8(decode_entities(strip_tags(check_markup($form_values['comment'], $form_values['format']))), 29, TRUE);
+    // Note: format is checked by check_markup().
+    $form_values['subject'] = trim(truncate_utf8(decode_entities(strip_tags(check_markup($form_values['comment'], $form_values['format']))), 29, TRUE));
+    // Edge cases where the comment body is populated only by HTML tags will
+    // require a default subject.
+    if ($form_values['subject'] == '') {
+      $form_values['subject'] = message_na();
+    }
   }
+
   return $form_values;
 }
 
