Index: modules/comment.module
===================================================================
--- modules/comment.module	(revision 5662)
+++ modules/comment.module	(working copy)
@@ -520,17 +520,6 @@
     }
   }
 
-  // Validate the comment's subject.  If not specified, extract
-  // one from the comment's body.
-  if (trim($edit['subject']) == '') {
-    // The body may be in any format, so we:
-    // 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().
-    $edit['subject'] = truncate_utf8(decode_entities(strip_tags(check_markup($edit['comment'], $edit['format']))), 29, TRUE);
-  }
-
   // Validate the comment's body.
   if ($edit['comment'] == '') {
     form_set_error('comment', t('The body of your comment is empty.'));
@@ -1231,6 +1230,17 @@
 
 function comment_form_execute($form_id, $form_values) {
 
+  // Validate the comment's subject.  If not specified, extract
+  // one from the comment's body.
+  if (trim($form_values['subject']) == '') {
+    // The body may be in any format, so we:
+    // 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);
+  }
+
   $op = isset($_POST['op']) ? $_POST['op'] : '';
   $nid = $form_values['nid'];
 
