diff options
author | Dries Buytaert <dries@buytaert.net> | 2008-09-06 08:36:22 +0000 |
---|---|---|
committer | Dries Buytaert <dries@buytaert.net> | 2008-09-06 08:36:22 +0000 |
commit | e5b0e5f76c0695a01d13c55147a8287df8750594 (patch) | |
tree | d4acfc3f1d038bccaea83e168fdd380d0dfa0708 /modules/comment | |
parent | cbb639a16ffec82f498ae689818b010e040bf5b4 (diff) | |
download | brdo-e5b0e5f76c0695a01d13c55147a8287df8750594.tar.gz brdo-e5b0e5f76c0695a01d13c55147a8287df8750594.tar.bz2 |
- Patch #302763 by Dave Reid, Rob Loach: replace time() by ['REQUEST_TIME'] as per Rasmus' suggestion. Removed drupal_referrer() for consistency.
Diffstat (limited to 'modules/comment')
-rw-r--r-- | modules/comment/comment.install | 4 | ||||
-rw-r--r-- | modules/comment/comment.module | 8 |
2 files changed, 6 insertions, 6 deletions
diff --git a/modules/comment/comment.install b/modules/comment/comment.install index 96f0e3dca..556d225d9 100644 --- a/modules/comment/comment.install +++ b/modules/comment/comment.install @@ -14,11 +14,11 @@ function comment_enable() { */ 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', time(), time()); + db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d', $_SERVER['REQUEST_TIME'], $_SERVER['REQUEST_TIME']); // Unstuck node indexing timestamp if needed. if (($last = variable_get('node_cron_last', FALSE)) !== FALSE) { - variable_set('node_cron_last', min(time(), $last)); + variable_set('node_cron_last', min($_SERVER['REQUEST_TIME'], $last)); } return array(); diff --git a/modules/comment/comment.module b/modules/comment/comment.module index 75d7f0088..4bf15133a 100644 --- a/modules/comment/comment.module +++ b/modules/comment/comment.module @@ -378,7 +378,7 @@ function theme_comment_block() { $items = array(); $number = variable_get('comment_block_count', 10); foreach (comment_get_recent($number) as $comment) { - $items[] = l($comment->subject, 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)) . '<br />' . t('@time ago', array('@time' => format_interval(time() - $comment->timestamp))); + $items[] = l($comment->subject, 'node/' . $comment->nid, array('fragment' => 'comment-' . $comment->cid)) . '<br />' . t('@time ago', array('@time' => format_interval($_SERVER['REQUEST_TIME'] - $comment->timestamp))); } if ($items) { @@ -712,7 +712,7 @@ function comment_save($edit) { } if (empty($edit['timestamp'])) { - $edit['timestamp'] = time(); + $edit['timestamp'] = $_SERVER['REQUEST_TIME']; } if ($edit['uid'] === $user->uid) { // '===' Need to modify anonymous users as well. @@ -1448,7 +1448,7 @@ function comment_form_add_preview($form, &$form_state) { $comment->name = variable_get('anonymous', t('Anonymous')); } - $comment->timestamp = !empty($edit['timestamp']) ? $edit['timestamp'] : time(); + $comment->timestamp = !empty($edit['timestamp']) ? $edit['timestamp'] : $_SERVER['REQUEST_TIME']; $output .= theme('comment_view', $comment, $node); } @@ -1490,7 +1490,7 @@ function comment_form_validate($form, &$form_state) { foreach (array('name', 'homepage', 'mail') as $field) { // Set cookie for 365 days. if (isset($form_state['values'][$field])) { - setcookie('comment_info_' . $field, $form_state['values'][$field], time() + 31536000, '/'); + setcookie('comment_info_' . $field, $form_state['values'][$field], $_SERVER['REQUEST_TIME'] + 31536000, '/'); } } } |