=== modified file 'modules/comment/comment.admin.inc'
--- modules/comment/comment.admin.inc	2009-09-18 00:12:45 +0000
+++ modules/comment/comment.admin.inc	2009-08-31 19:13:41 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment.admin.inc,v 1.32 2009/09/18 00:12:45 webchick Exp $
+// $Id: comment.admin.inc,v 1.31 2009/08/25 10:27:14 dries Exp $
 
 /**
  * @file
@@ -34,7 +34,7 @@ function comment_admin($type = 'new') {
  * @see comment_admin_overview_submit()
  * @see theme_comment_admin_overview()
  */
-function comment_admin_overview($form, &$form_state, $arg) {
+function comment_admin_overview($type = 'new', $arg) {
   // Build an 'Update options' form.
   $form['options'] = array(
     '#type' => 'fieldset',
@@ -159,7 +159,7 @@ function comment_admin_overview_submit($
  * @ingroup forms
  * @see comment_multiple_delete_confirm_submit()
  */
-function comment_multiple_delete_confirm($form, &$form_state) {
+function comment_multiple_delete_confirm(&$form_state) {
   $edit = $form_state['input'];
 
   $form['comments'] = array(
@@ -232,7 +232,8 @@ function comment_delete_page($cid = NULL
  * @ingroup forms
  * @see comment_confirm_delete_submit()
  */
-function comment_confirm_delete($form, &$form_state, $comment) {
+function comment_confirm_delete(&$form_state, $comment) {
+  $form = array();
   $form['#comment'] = $comment;
   return confirm_form(
     $form,

=== modified file 'modules/comment/comment.install'
--- modules/comment/comment.install	2009-09-18 00:04:21 +0000
+++ modules/comment/comment.install	2009-09-13 21:42:24 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment.install,v 1.46 2009/09/18 00:04:22 webchick Exp $
+// $Id: comment.install,v 1.45 2009/09/10 06:38:17 dries Exp $
 
 /**
  * @file
@@ -46,6 +46,21 @@ function comment_enable() {
 }
 
 /**
+ * Changed node_comment_statistics to use node->changed to avoid future timestamps.
+ */
+function comment_update_1() {
+  // Change any future last comment timestamps to current time.
+  db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d', REQUEST_TIME, REQUEST_TIME);
+
+  // Unstuck node indexing timestamp if needed.
+  if (($last = variable_get('node_cron_last', FALSE)) !== FALSE) {
+    variable_set('node_cron_last', min(REQUEST_TIME, $last));
+  }
+
+  return array();
+}
+
+/**
  * @defgroup updates-6.x-to-7.x Comment updates from 6.x to 7.x
  * @{
  */

=== modified file 'modules/comment/comment.module'
--- modules/comment/comment.module	2009-09-22 07:36:57 +0000
+++ modules/comment/comment.module	2009-09-14 19:20:07 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment.module,v 1.774 2009/09/22 07:36:57 dries Exp $
+// $Id: comment.module,v 1.769 2009/09/11 13:37:52 webchick Exp $
 
 /**
  * @file
@@ -435,7 +435,7 @@ function comment_new_page_count($num_com
       WHERE nid = :nid
         AND status = 0
       ORDER BY timestamp DESC) AS thread
-      ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1))', 0, $new_replies, array(':nid' => $node->nid))->fetchField();
+      ORDER BY SUBSTRING(thread, 1, (LENGTH(thread) - 1))', array(':nid' => $node->nid), 0, $new_replies)->fetchField();
     $thread = substr($result, 0, -1);
     $count = db_query('SELECT COUNT(*) FROM {comment} WHERE nid = :nid AND status = 0 AND SUBSTRING(thread, 1, (LENGTH(thread) - 1)) < :thread', array(
       ':nid' => $node->nid,
@@ -1616,7 +1616,7 @@ function comment_get_display_page($cid, 
  * @see comment_form_validate()
  * @see comment_form_submit()
  */
-function comment_form($form, &$form_state, $comment) {
+function comment_form(&$form_state, $comment) {
   global $user;
 
   $op = isset($_POST['op']) ? $_POST['op'] : '';
@@ -1634,6 +1634,7 @@ function comment_form($form, &$form_stat
   $comment += array('name' => '', 'mail' => '', 'homepage' => '');
   $comment = (object) $comment;
 
+  $form = array();
   if (isset($form_state['comment_preview'])) {
     $form += $form_state['comment_preview'];
   }
@@ -1814,7 +1815,7 @@ function comment_form($form, &$form_stat
     '#title' => t('Comment'),
     '#rows' => 15,
     '#default_value' => $default,
-    '#text_format' => isset($comment->format) ? $comment->format : filter_default_format(),
+    '#text_format' => isset($comment->format) ? $comment->format : FILTER_FORMAT_DEFAULT,
     '#required' => TRUE,
   );
 
@@ -2064,21 +2065,16 @@ function comment_form_submit($form, &$fo
     else {
       drupal_set_message(t('Your comment has been posted.'));
     }
-    $query = array();
-    // Find the current display page for this comment.
-    $page = comment_get_display_page($comment->cid, $node->type);
-    if ($page > 0) {
-      $query['page'] = $page;
-    }
-    // Redirect to the newly posted comment.
-    $redirect = array('node/' . $node->nid, $query, 'comment-' . $comment->cid);
+    $redirect = array('comment/' . $comment->cid, array(), 'comment-' . $comment->cid);
   }
   else {
     watchdog('content', 'Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject), WATCHDOG_WARNING);
     drupal_set_message(t('Comment: unauthorized comment submitted or comment submitted to a closed post %subject.', array('%subject' => $comment->subject)), 'error');
-    // Redirect the user to the node they are commenting on.
-    $redirect = 'node/' . $node->nid;
+    $page = comment_new_page_count($node->comment_count, 1, $node);
+    $redirect = array('node/' . $node->nid, $page);
   }
+
+  // Redirect the user to the node they're commenting on.
   unset($form_state['rebuild']);
   $form_state['redirect'] = $redirect;
 }
@@ -2100,12 +2096,12 @@ function template_preprocess_comment(&$v
   $variables['signature'] = $comment->signature;
   $variables['title']     = l($comment->subject, 'comment/' . $comment->cid, array('fragment' => "comment-$comment->cid"));
   $variables['template_files'][] = 'comment-' . $variables['node']->type;
-  
+
   // Helpful $content variable for templates.
   foreach (element_children($variables['elements']) as $key) {
     $variables['content'][$key] = $variables['elements'][$key];
   }
-  
+
   // Set status to a string representation of comment->status.
   if (isset($comment->in_preview)) {
     $variables['status']  = 'comment-preview';
@@ -2244,10 +2240,10 @@ function _comment_update_node_statistics
 
   if ($count > 0) {
     // Comments exist.
-    $last_reply = db_query_range('SELECT cid, name, timestamp, uid FROM {comment} WHERE nid = :nid AND status = :status ORDER BY cid DESC', 0, 1, array(
+    $last_reply = db_query_range('SELECT cid, name, timestamp, uid FROM {comment} WHERE nid = :nid AND status = :status ORDER BY cid DESC', array(
       ':nid' => $nid,
       ':status' => COMMENT_PUBLISHED,
-    ))->fetchObject();
+    ), 0, 1)->fetchObject();
     db_update('node_comment_statistics')
       ->fields( array(
         'comment_count' => $count,
@@ -2301,21 +2297,49 @@ function vancode2int($c = '00') {
 }
 
 /**
+ * Implement hook_hook_info().
+ */
+function comment_hook_info() {
+  return array(
+    'comment' => array(
+      'comment' => array(
+        'insert' => array(
+          'runs when' => t('After saving a new comment'),
+        ),
+        'update' => array(
+          'runs when' => t('After saving an updated comment'),
+        ),
+        'delete' => array(
+          'runs when' => t('After deleting a comment')
+        ),
+        'view' => array(
+          'runs when' => t('When a comment is being viewed by an authenticated user')
+        ),
+      ),
+    ),
+  );
+}
+
+/**
  * Implement hook_action_info().
  */
 function comment_action_info() {
   return array(
     'comment_unpublish_action' => array(
-      'label' => t('Unpublish comment'),
+      'description' => t('Unpublish comment'),
       'type' => 'comment',
       'configurable' => FALSE,
-      'triggers' => array('comment_insert', 'comment_update'),
+      'hooks' => array(
+        'comment' => array('insert', 'update'),
+      )
     ),
     'comment_unpublish_by_keyword_action' => array(
-      'label' => t('Unpublish comment containing keyword(s)'),
+      'description' => t('Unpublish comment containing keyword(s)'),
       'type' => 'comment',
       'configurable' => TRUE,
-      'triggers' => array('comment_insert', 'comment_update'),
+      'hooks' => array(
+        'comment' => array('insert', 'update'),
+      )
     )
   );
 }
@@ -2423,10 +2447,31 @@ function comment_menu_alter(&$items) {
 /**
  * Implement hook_filter_format_delete().
  */
-function comment_filter_format_delete($format, $fallback) {
+function comment_filter_format_delete($format, $default) {
   db_update('comment')
-    ->fields(array('format' => $fallback->format))
+    ->fields(array('format' => $default->format))
     ->condition('format', $format->format)
     ->execute();
 }
 
+function comment_rdf_mapping() {
+  return array(
+    'comment' => array(
+      'rdftype' => array('sioct:Post'),
+      'title'   => array(
+        'property' => array('dc:title'),
+      ),
+      'created' => array(
+        'property' => array('dc:date', 'dc:created'),
+        'datatype' => 'xsd:dateTime',
+        'callback' => 'date_iso8601',
+      ),
+      'replyof' => array(
+        'property' => array('sioct:reply_of'),
+      ),
+      'name' => array(
+        'property' => array('dc:creator'),
+      ),
+    )
+  );
+}

=== modified file 'modules/comment/comment.test'
--- modules/comment/comment.test	2009-09-22 07:36:57 +0000
+++ modules/comment/comment.test	2009-08-31 19:13:41 +0000
@@ -1,5 +1,5 @@
 <?php
-// $Id: comment.test,v 1.45 2009/09/22 07:36:57 dries Exp $
+// $Id: comment.test,v 1.44 2009/08/21 14:27:44 dries Exp $
 
 class CommentHelperCase extends DrupalWebTestCase {
   protected $admin_user;
@@ -46,7 +46,7 @@ class CommentHelperCase extends DrupalWe
     $this->drupalPost(NULL, $edit, t('Save'));
     $match = array();
     // Get comment ID
-    preg_match('/#comment-([0-9]+)/', $this->getURL(), $match);
+    preg_match('/#comment-([^"]+)/', $this->getURL(), $match);
 
     // Get comment.
     if ($contact !== TRUE) { // If true then attempting to find error message.

