summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/aggregator/aggregator.admin.inc2
-rw-r--r--modules/aggregator/aggregator.module12
-rw-r--r--modules/aggregator/aggregator.pages.inc6
-rw-r--r--modules/blogapi/blogapi.module2
-rw-r--r--modules/comment/comment.install4
-rw-r--r--modules/comment/comment.module8
-rw-r--r--modules/dblog/dblog.test4
-rw-r--r--modules/filter/filter.module2
-rw-r--r--modules/forum/forum.module2
-rw-r--r--modules/node/node.module16
-rw-r--r--modules/node/node.pages.inc4
-rw-r--r--modules/openid/openid.module4
-rw-r--r--modules/poll/poll.module2
-rw-r--r--modules/search/search.module2
-rw-r--r--modules/search/search.test2
-rw-r--r--modules/simpletest/drupal_web_test_case.php2
-rw-r--r--modules/simpletest/tests/session.test2
-rw-r--r--modules/simpletest/tests/xmlrpc.test2
-rw-r--r--modules/statistics/statistics.admin.inc2
-rw-r--r--modules/statistics/statistics.module12
-rw-r--r--modules/statistics/statistics.test2
-rw-r--r--modules/system/system.admin.inc14
-rw-r--r--modules/system/system.install8
-rw-r--r--modules/system/system.module8
-rw-r--r--modules/tracker/tracker.pages.inc2
-rw-r--r--modules/update/update.compare.inc6
-rw-r--r--modules/update/update.fetch.inc4
-rw-r--r--modules/update/update.module4
-rw-r--r--modules/update/update.report.inc2
-rw-r--r--modules/user/user.admin.inc4
-rw-r--r--modules/user/user.module18
-rw-r--r--modules/user/user.pages.inc2
-rw-r--r--modules/user/user.test2
33 files changed, 84 insertions, 84 deletions
diff --git a/modules/aggregator/aggregator.admin.inc b/modules/aggregator/aggregator.admin.inc
index 359771b68..3fdad5c69 100644
--- a/modules/aggregator/aggregator.admin.inc
+++ b/modules/aggregator/aggregator.admin.inc
@@ -27,7 +27,7 @@ function aggregator_view() {
$header = array(t('Title'), t('Items'), t('Last update'), t('Next update'), array('data' => t('Operations'), 'colspan' => '3'));
$rows = array();
while ($feed = db_fetch_object($result)) {
- $rows[] = array(l($feed->title, "aggregator/sources/$feed->fid"), format_plural($feed->items, '1 item', '@count items'), ($feed->checked ? t('@time ago', array('@time' => format_interval(time() - $feed->checked))) : t('never')), ($feed->checked ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - time()))) : t('never')), l(t('edit'), "admin/content/aggregator/edit/feed/$feed->fid"), l(t('remove items'), "admin/content/aggregator/remove/$feed->fid"), l(t('update items'), "admin/content/aggregator/update/$feed->fid"));
+ $rows[] = array(l($feed->title, "aggregator/sources/$feed->fid"), format_plural($feed->items, '1 item', '@count items'), ($feed->checked ? t('@time ago', array('@time' => format_interval($_SERVER['REQUEST_TIME'] - $feed->checked))) : t('never')), ($feed->checked ? t('%time left', array('%time' => format_interval($feed->checked + $feed->refresh - $_SERVER['REQUEST_TIME']))) : t('never')), l(t('edit'), "admin/content/aggregator/edit/feed/$feed->fid"), l(t('remove items'), "admin/content/aggregator/remove/$feed->fid"), l(t('update items'), "admin/content/aggregator/update/$feed->fid"));
}
$output .= theme('table', $header, $rows);
diff --git a/modules/aggregator/aggregator.module b/modules/aggregator/aggregator.module
index 50ec8c0e2..851fc38a1 100644
--- a/modules/aggregator/aggregator.module
+++ b/modules/aggregator/aggregator.module
@@ -281,7 +281,7 @@ function aggregator_perm() {
* Checks news feeds for updates once their refresh interval has elapsed.
*/
function aggregator_cron() {
- $result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < %d', time());
+ $result = db_query('SELECT * FROM {aggregator_feed} WHERE checked + refresh < %d', $_SERVER['REQUEST_TIME']);
while ($feed = db_fetch_array($result)) {
aggregator_refresh($feed);
}
@@ -592,7 +592,7 @@ function aggregator_refresh($feed) {
// Process HTTP response code.
switch ($result->code) {
case 304:
- db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', time(), $feed['fid']);
+ db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', $_SERVER['REQUEST_TIME'], $feed['fid']);
drupal_set_message(t('There is no new syndicated content from %site.', array('%site' => $feed['title'])));
break;
case 301:
@@ -606,7 +606,7 @@ function aggregator_refresh($feed) {
// data. If both are equal we say that feed is not updated.
$md5 = md5($result->data);
if ($feed['hash'] == $md5) {
- db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', time(), $feed['fid']);
+ db_query('UPDATE {aggregator_feed} SET checked = %d WHERE fid = %d', $_SERVER['REQUEST_TIME'], $feed['fid']);
drupal_set_message(t('There is no new syndicated content from %site.', array('%site' => $feed['title'])));
break;
}
@@ -636,7 +636,7 @@ function aggregator_refresh($feed) {
$etag = empty($result->headers['ETag']) ? '' : $result->headers['ETag'];
// Update the feed data.
- db_query("UPDATE {aggregator_feed} SET url = '%s', checked = %d, link = '%s', description = '%s', image = '%s', hash = '%s', etag = '%s', modified = %d WHERE fid = %d", $feed['url'], time(), $channel['LINK'], $channel['DESCRIPTION'], $image, $md5, $etag, $modified, $feed['fid']);
+ db_query("UPDATE {aggregator_feed} SET url = '%s', checked = %d, link = '%s', description = '%s', image = '%s', hash = '%s', etag = '%s', modified = %d WHERE fid = %d", $feed['url'], $_SERVER['REQUEST_TIME'], $channel['LINK'], $channel['DESCRIPTION'], $image, $md5, $etag, $modified, $feed['fid']);
// Clear the cache.
cache_clear_all();
@@ -803,14 +803,14 @@ function aggregator_parse_feed(&$data, $feed) {
}
if (!$timestamp) {
- $timestamp = isset($entry->timestamp) ? $entry->timestamp : time();
+ $timestamp = isset($entry->timestamp) ? $entry->timestamp : $_SERVER['REQUEST_TIME'];
}
$item += array('AUTHOR' => '', 'DESCRIPTION' => '');
aggregator_save_item(array('iid' => (isset($entry->iid) ? $entry->iid : ''), 'fid' => $feed['fid'], 'timestamp' => $timestamp, 'title' => $title, 'link' => $link, 'author' => $item['AUTHOR'], 'description' => $item['DESCRIPTION'], 'guid' => $guid));
}
// Remove all items that are older than flush item timer.
- $age = time() - variable_get('aggregator_clear', 9676800);
+ $age = $_SERVER['REQUEST_TIME'] - variable_get('aggregator_clear', 9676800);
$result = db_query('SELECT iid FROM {aggregator_item} WHERE fid = %d AND timestamp < %d', $feed['fid'], $age);
$items = array();
diff --git a/modules/aggregator/aggregator.pages.inc b/modules/aggregator/aggregator.pages.inc
index 7add58841..6406cded6 100644
--- a/modules/aggregator/aggregator.pages.inc
+++ b/modules/aggregator/aggregator.pages.inc
@@ -265,7 +265,7 @@ function template_preprocess_aggregator_item(&$variables) {
$variables['source_title'] = check_plain($item->ftitle);
}
if (date('Ymd', $item->timestamp) == date('Ymd')) {
- $variables['source_date'] = t('%ago ago', array('%ago' => format_interval(time() - $item->timestamp)));
+ $variables['source_date'] = t('%ago ago', array('%ago' => format_interval($_SERVER['REQUEST_TIME'] - $item->timestamp)));
}
else {
$variables['source_date'] = format_date($item->timestamp, 'custom', variable_get('date_format_medium', 'D, m/d/Y - H:i'));
@@ -462,7 +462,7 @@ function template_preprocess_aggregator_summary_item(&$variables) {
$variables['feed_url'] = check_url($item->link);
$variables['feed_title'] = check_plain($item->title);
- $variables['feed_age'] = t('%age old', array('%age' => format_interval(time() - $item->timestamp)));
+ $variables['feed_age'] = t('%age old', array('%age' => format_interval($_SERVER['REQUEST_TIME'] - $item->timestamp)));
$variables['source_url'] = '';
$variables['source_title'] = '';
@@ -486,7 +486,7 @@ function template_preprocess_aggregator_feed_source(&$variables) {
$variables['source_url'] = check_url(url($feed->link, array('absolute' => TRUE)));
if ($feed->checked) {
- $variables['last_checked'] = t('@time ago', array('@time' => format_interval(time() - $feed->checked)));
+ $variables['last_checked'] = t('@time ago', array('@time' => format_interval($_SERVER['REQUEST_TIME'] - $feed->checked)));
}
else {
$variables['last_checked'] = t('never');
diff --git a/modules/blogapi/blogapi.module b/modules/blogapi/blogapi.module
index 56408dbb4..e14c1e689 100644
--- a/modules/blogapi/blogapi.module
+++ b/modules/blogapi/blogapi.module
@@ -218,7 +218,7 @@ function blogapi_blogger_new_post($appkey, $blogid, $username, $password, $conte
}
if (user_access('administer nodes') && !isset($edit['date'])) {
- $edit['date'] = format_date(time(), 'custom', 'Y-m-d H:i:s O');
+ $edit['date'] = format_date($_SERVER['REQUEST_TIME'], 'custom', 'Y-m-d H:i:s O');
}
node_invoke_nodeapi($edit, 'blogapi new');
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, '/');
}
}
}
diff --git a/modules/dblog/dblog.test b/modules/dblog/dblog.test
index 376e0e2be..122a55b0f 100644
--- a/modules/dblog/dblog.test
+++ b/modules/dblog/dblog.test
@@ -102,9 +102,9 @@ class DBLogTestCase extends DrupalWebTestCase {
'link' => NULL,
'user' => $this->big_user,
'request_uri' => $base_root . request_uri(),
- 'referer' => referer_uri(),
+ 'referer' => $_SERVER['HTTP_REFERER'],
'ip' => ip_address(),
- 'timestamp' => time(),
+ 'timestamp' => $_SERVER['REQUEST_TIME'],
);
$message = 'Log entry added to test the dblog row limit.';
for ($i = 0; $i < $count; $i++) {
diff --git a/modules/filter/filter.module b/modules/filter/filter.module
index 198c828e3..9dd7a7e3a 100644
--- a/modules/filter/filter.module
+++ b/modules/filter/filter.module
@@ -446,7 +446,7 @@ function check_markup($text, $format = FILTER_FORMAT_DEFAULT, $check = TRUE) {
// Store in cache with a minimum expiration time of 1 day.
if ($cache) {
- cache_set($cache_id, $text, 'cache_filter', time() + (60 * 60 * 24));
+ cache_set($cache_id, $text, 'cache_filter', $_SERVER['REQUEST_TIME'] + (60 * 60 * 24));
}
}
else {
diff --git a/modules/forum/forum.module b/modules/forum/forum.module
index ac245a498..987e37dc7 100644
--- a/modules/forum/forum.module
+++ b/modules/forum/forum.module
@@ -908,7 +908,7 @@ function template_preprocess_forum_topic_navigation(&$variables) {
*/
function template_preprocess_forum_submitted(&$variables) {
$variables['author'] = isset($variables['topic']->uid) ? theme('username', $variables['topic']) : '';
- $variables['time'] = isset($variables['topic']->timestamp) ? format_interval(time() - $variables['topic']->timestamp) : '';
+ $variables['time'] = isset($variables['topic']->timestamp) ? format_interval($_SERVER['REQUEST_TIME'] - $variables['topic']->timestamp) : '';
}
function _forum_user_last_visit($nid) {
diff --git a/modules/node/node.module b/modules/node/node.module
index 70129354a..8b966dd78 100644
--- a/modules/node/node.module
+++ b/modules/node/node.module
@@ -13,7 +13,7 @@
* Nodes changed after this time may be marked new, updated, or read, depending
* on their state for the current user. Defaults to 30 days ago.
*/
-define('NODE_NEW_LIMIT', time() - 30 * 24 * 60 * 60);
+define('NODE_NEW_LIMIT', $_SERVER['REQUEST_TIME'] - 30 * 24 * 60 * 60);
/**
* Node is being built before being viewed normally.
@@ -188,10 +188,10 @@ function node_tag_new($nid) {
if ($user->uid) {
if (node_last_viewed($nid)) {
- db_query('UPDATE {history} SET timestamp = %d WHERE uid = %d AND nid = %d', time(), $user->uid, $nid);
+ db_query('UPDATE {history} SET timestamp = %d WHERE uid = %d AND nid = %d', $_SERVER['REQUEST_TIME'], $user->uid, $nid);
}
else {
- @db_query('INSERT INTO {history} (uid, nid, timestamp) VALUES (%d, %d, %d)', $user->uid, $nid, time());
+ @db_query('INSERT INTO {history} (uid, nid, timestamp) VALUES (%d, %d, %d)', $user->uid, $nid, $_SERVER['REQUEST_TIME']);
}
}
}
@@ -880,7 +880,7 @@ function node_submit($node) {
$node->uid = 0;
}
}
- $node->created = !empty($node->date) ? strtotime($node->date) : time();
+ $node->created = !empty($node->date) ? strtotime($node->date) : $_SERVER['REQUEST_TIME'];
$node->validated = TRUE;
return $node;
@@ -932,12 +932,12 @@ function node_save(&$node) {
// Set some required fields:
if (empty($node->created)) {
- $node->created = time();
+ $node->created = $_SERVER['REQUEST_TIME'];
}
// The changed timestamp is always updated for bookkeeping purposes (revisions, searching, ...)
- $node->changed = time();
+ $node->changed = $_SERVER['REQUEST_TIME'];
- $node->timestamp = time();
+ $node->timestamp = $_SERVER['REQUEST_TIME'];
$node->format = isset($node->format) ? $node->format : FILTER_FORMAT_DEFAULT;
$update_node = TRUE;
@@ -1221,7 +1221,7 @@ function node_search($op = 'search', $keys = NULL) {
return t('Content');
case 'reset':
- db_query("UPDATE {search_dataset} SET reindex = %d WHERE type = 'node'", time());
+ db_query("UPDATE {search_dataset} SET reindex = %d WHERE type = 'node'", $_SERVER['REQUEST_TIME']);
return;
case 'status':
diff --git a/modules/node/node.pages.inc b/modules/node/node.pages.inc
index 7d087fe95..74227ce4d 100644
--- a/modules/node/node.pages.inc
+++ b/modules/node/node.pages.inc
@@ -80,7 +80,7 @@ function node_object_prepare(&$node) {
}
global $user;
$node->uid = $user->uid;
- $node->created = time();
+ $node->created = $_SERVER['REQUEST_TIME'];
}
else {
$node->date = format_date($node->created, 'custom', 'Y-m-d H:i:s O');
@@ -361,7 +361,7 @@ function node_preview($node) {
$node->picture = $user->picture;
}
- $node->changed = time();
+ $node->changed = $_SERVER['REQUEST_TIME'];
// Extract a teaser, if it hasn't been set (e.g. by a module-provided
// 'teaser' form item).
diff --git a/modules/openid/openid.module b/modules/openid/openid.module
index a62a3e0f4..c44d95a1d 100644
--- a/modules/openid/openid.module
+++ b/modules/openid/openid.module
@@ -333,7 +333,7 @@ function openid_association($op_endpoint) {
module_load_include('inc', 'openid');
// Remove Old Associations:
- db_query("DELETE FROM {openid_association} WHERE created + expires_in < %d", time());
+ db_query("DELETE FROM {openid_association} WHERE created + expires_in < %d", $_SERVER['REQUEST_TIME']);
// Check to see if we have an association for this IdP already
$assoc_handle = db_result(db_query("SELECT assoc_handle FROM {openid_association} WHERE idp_endpoint_uri = '%s'", $op_endpoint));
@@ -367,7 +367,7 @@ function openid_association($op_endpoint) {
$assoc_response['mac_key'] = base64_encode(_openid_dh_xorsecret($shared, $enc_mac_key));
}
db_query("INSERT INTO {openid_association} (idp_endpoint_uri, session_type, assoc_handle, assoc_type, expires_in, mac_key, created) VALUES('%s', '%s', '%s', '%s', %d, '%s', %d)",
- $op_endpoint, $assoc_response['session_type'], $assoc_response['assoc_handle'], $assoc_response['assoc_type'], $assoc_response['expires_in'], $assoc_response['mac_key'], time());
+ $op_endpoint, $assoc_response['session_type'], $assoc_response['assoc_handle'], $assoc_response['assoc_type'], $assoc_response['expires_in'], $assoc_response['mac_key'], $_SERVER['REQUEST_TIME']);
$assoc_handle = $assoc_response['assoc_handle'];
}
diff --git a/modules/poll/poll.module b/modules/poll/poll.module
index b0368d207..4c4962a97 100644
--- a/modules/poll/poll.module
+++ b/modules/poll/poll.module
@@ -161,7 +161,7 @@ function poll_block($op = 'list', $delta = '') {
* Closes polls that have exceeded their allowed runtime.
*/
function poll_cron() {
- $result = db_query('SELECT p.nid FROM {poll} p INNER JOIN {node} n ON p.nid = n.nid WHERE (n.created + p.runtime) < ' . time() . ' AND p.active = 1 AND p.runtime != 0');
+ $result = db_query('SELECT p.nid FROM {poll} p INNER JOIN {node} n ON p.nid = n.nid WHERE (n.created + p.runtime) < ' . $_SERVER['REQUEST_TIME'] . ' AND p.active = 1 AND p.runtime != 0');
while ($poll = db_fetch_object($result)) {
db_query("UPDATE {poll} SET active = 0 WHERE nid = %d", $poll->nid);
}
diff --git a/modules/search/search.module b/modules/search/search.module
index 92b7ee2c6..152fb45eb 100644
--- a/modules/search/search.module
+++ b/modules/search/search.module
@@ -622,7 +622,7 @@ function search_index($sid, $type, $text) {
* The nid of the node that needs reindexing.
*/
function search_touch_node($nid) {
- db_query("UPDATE {search_dataset} SET reindex = %d WHERE sid = %d AND type = 'node'", time(), $nid);
+ db_query("UPDATE {search_dataset} SET reindex = %d WHERE sid = %d AND type = 'node'", $_SERVER['REQUEST_TIME'], $nid);
}
/**
diff --git a/modules/search/search.test b/modules/search/search.test
index 647e20cd9..45ff94c8a 100644
--- a/modules/search/search.test
+++ b/modules/search/search.test
@@ -236,7 +236,7 @@ class SearchRankingTestCase extends DrupalWebTestCase {
$settings['body'] .= " really rocks";
break;
case 'recent':
- $settings['created'] = time() + 3600;
+ $settings['created'] = $_SERVER['REQUEST_TIME'] + 3600;
break;
case 'comments':
$settings['comment'] = 2;
diff --git a/modules/simpletest/drupal_web_test_case.php b/modules/simpletest/drupal_web_test_case.php
index b5394bfc2..d06b5731c 100644
--- a/modules/simpletest/drupal_web_test_case.php
+++ b/modules/simpletest/drupal_web_test_case.php
@@ -331,7 +331,7 @@ class DrupalWebTestCase {
'body' => $this->randomName(32),
'title' => $this->randomName(8),
'comment' => 2,
- 'changed' => time(),
+ 'changed' => $_SERVER['REQUEST_TIME'],
'format' => FILTER_FORMAT_DEFAULT,
'moderate' => 0,
'promote' => 0,
diff --git a/modules/simpletest/tests/session.test b/modules/simpletest/tests/session.test
index 2e564e0bf..b4835832d 100644
--- a/modules/simpletest/tests/session.test
+++ b/modules/simpletest/tests/session.test
@@ -113,7 +113,7 @@ class SessionTestCase extends DrupalWebTestCase {
$this->assertEqual($authenticated, $this->session_count_authenticated, t('Correctly counted @count authenticated sessions.', array('@count' => $authenticated)), t('Session'));
// Should return 0 sessions from 1 second from now.
- $this->assertEqual(sess_count(time() + 1), 0, t('Correctly returned 0 sessions newer than the current time.'), t('Session'));
+ $this->assertEqual(sess_count($_SERVER['REQUEST_TIME'] + 1), 0, t('Correctly returned 0 sessions newer than the current time.'), t('Session'));
}
diff --git a/modules/simpletest/tests/xmlrpc.test b/modules/simpletest/tests/xmlrpc.test
index 799f69081..df44c0ac1 100644
--- a/modules/simpletest/tests/xmlrpc.test
+++ b/modules/simpletest/tests/xmlrpc.test
@@ -66,7 +66,7 @@ class XMLRPCValidator1IncTestCase extends DrupalWebTestCase {
$bool_5 = (($int_5 % 2) == 0);
$string_5 = $this->randomName();
$double_5 = (double)(mt_rand(-1000,1000) / 100);
- $time_5 = time();
+ $time_5 = $_SERVER['REQUEST_TIME'];
$base64_5 = $this->randomName(100);
$l_res_5 = xmlrpc_test_manyTypesTest($int_5, $bool_5, $string_5, $double_5, xmlrpc_date($time_5), $base64_5);
$l_res_5[5] = $l_res_5[5]->data; /* override warpping */
diff --git a/modules/statistics/statistics.admin.inc b/modules/statistics/statistics.admin.inc
index 891abe81e..f10d9ca7f 100644
--- a/modules/statistics/statistics.admin.inc
+++ b/modules/statistics/statistics.admin.inc
@@ -122,7 +122,7 @@ function statistics_top_referrers() {
$rows = array();
while ($referrer = db_fetch_object($result)) {
- $rows[] = array($referrer->hits, _statistics_link($referrer->url), t('@time ago', array('@time' => format_interval(time() - $referrer->last))));
+ $rows[] = array($referrer->hits, _statistics_link($referrer->url), t('@time ago', array('@time' => format_interval($_SERVER['REQUEST_TIME'] - $referrer->last))));
}
if (empty($rows)) {
diff --git a/modules/statistics/statistics.module b/modules/statistics/statistics.module
index 4242aec5b..32504dfde 100644
--- a/modules/statistics/statistics.module
+++ b/modules/statistics/statistics.module
@@ -55,7 +55,7 @@ function statistics_exit() {
'daycount' => 1,
'totalcount' => 1,
'nid' => arg(1),
- 'timestamp' => time(),
+ 'timestamp' => $_SERVER['REQUEST_TIME'],
);
db_merge('node_counter')
->fields($fields)
@@ -69,12 +69,12 @@ function statistics_exit() {
db_insert('accesslog')->fields(array(
'title' => strip_tags(drupal_get_title()),
'path' => $_GET['q'],
- 'url' => referer_uri(),
+ 'url' => $_SERVER['HTTP_REFERER'],
'hostname' => ip_address(),
'uid' => $user->uid,
'sid' => session_id(),
'timer' => timer_read('page'),
- 'timestamp' => time(),
+ 'timestamp' => $_SERVER['REQUEST_TIME'],
))->execute();
}
}
@@ -188,14 +188,14 @@ function statistics_user($op, &$edit, &$user) {
function statistics_cron() {
$statistics_timestamp = variable_get('statistics_day_timestamp', '');
- if ((time() - $statistics_timestamp) >= 86400) {
+ if (($_SERVER['REQUEST_TIME'] - $statistics_timestamp) >= 86400) {
// Reset day counts.
db_query('UPDATE {node_counter} SET daycount = 0');
- variable_set('statistics_day_timestamp', time());
+ variable_set('statistics_day_timestamp', $_SERVER['REQUEST_TIME']);
}
// Clean up expired access logs.
- db_query('DELETE FROM {accesslog} WHERE timestamp < %d', time() - variable_get('statistics_flush_accesslog_timer', 259200));
+ db_query('DELETE FROM {accesslog} WHERE timestamp < %d', $_SERVER['REQUEST_TIME'] - variable_get('statistics_flush_accesslog_timer', 259200));
}
/**
diff --git a/modules/statistics/statistics.test b/modules/statistics/statistics.test
index 5375d1f25..549326411 100644
--- a/modules/statistics/statistics.test
+++ b/modules/statistics/statistics.test
@@ -23,7 +23,7 @@ class StatisticsBlockVisitorsTestCase extends DrupalWebTestCase {
$this->blocking_user = $this->drupalCreateUser(array('block IP addresses', 'access statistics'));
// Insert dummy access by anonymous user into access log.
- db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, sid, timer, timestamp) values('%s', '%s', '%s', '%s', %d, '%s', %d, %d)", 'test', 'node/1', 'http://example.com', '192.168.1.1', '0', '10', '10', time());
+ db_query("INSERT INTO {accesslog} (title, path, url, hostname, uid, sid, timer, timestamp) values('%s', '%s', '%s', '%s', %d, '%s', %d, %d)", 'test', 'node/1', 'http://example.com', '192.168.1.1', '0', '10', '10', $_SERVER['REQUEST_TIME']);
}
/**
diff --git a/modules/system/system.admin.inc b/modules/system/system.admin.inc
index fb58f660e..c3f7e05b2 100644
--- a/modules/system/system.admin.inc
+++ b/modules/system/system.admin.inc
@@ -1557,13 +1557,13 @@ function system_date_time_settings() {
// Date settings: construct choices for user
foreach ($date_short as $f) {
- $date_short_choices[$f] = format_date(time(), 'custom', $f);
+ $date_short_choices[$f] = format_date($_SERVER['REQUEST_TIME'], 'custom', $f);
}
foreach ($date_medium as $f) {
- $date_medium_choices[$f] = format_date(time(), 'custom', $f);
+ $date_medium_choices[$f] = format_date($_SERVER['REQUEST_TIME'], 'custom', $f);
}
foreach ($date_long as $f) {
- $date_long_choices[$f] = format_date(time(), 'custom', $f);
+ $date_long_choices[$f] = format_date($_SERVER['REQUEST_TIME'], 'custom', $f);
}
$date_long_choices['custom'] = $date_medium_choices['custom'] = $date_short_choices['custom'] = t('Custom format');
@@ -1622,7 +1622,7 @@ function system_date_time_settings() {
'#title' => t('Custom short date format'),
'#attributes' => array('class' => 'custom-format'),
'#default_value' => $default_short_custom,
- '#description' => t('A user-defined short date format. See the <a href="@url">PHP manual</a> for available options. This format is currently set to display as <span>%date</span>.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date(time(), 'custom', $default_short_custom))),
+ '#description' => t('A user-defined short date format. See the <a href="@url">PHP manual</a> for available options. This format is currently set to display as <span>%date</span>.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date($_SERVER['REQUEST_TIME'], 'custom', $default_short_custom))),
);
$date_format_medium = variable_get('date_format_medium', $date_medium[1]);
@@ -1645,7 +1645,7 @@ function system_date_time_settings() {
'#title' => t('Custom medium date format'),
'#attributes' => array('class' => 'custom-format'),
'#default_value' => $default_medium_custom,
- '#description' => t('A user-defined medium date format. See the <a href="@url">PHP manual</a> for available options. This format is currently set to display as <span>%date</span>.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date(time(), 'custom', $default_medium_custom))),
+ '#description' => t('A user-defined medium date format. See the <a href="@url">PHP manual</a> for available options. This format is currently set to display as <span>%date</span>.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date($_SERVER['REQUEST_TIME'], 'custom', $default_medium_custom))),
);
$date_format_long = variable_get('date_format_long', $date_long[0]);
@@ -1668,7 +1668,7 @@ function system_date_time_settings() {
'#title' => t('Custom long date format'),
'#attributes' => array('class' => 'custom-format'),
'#default_value' => $default_long_custom,
- '#description' => t('A user-defined long date format. See the <a href="@url">PHP manual</a> for available options. This format is currently set to display as <span>%date</span>.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date(time(), 'custom', $default_long_custom))),
+ '#description' => t('A user-defined long date format. See the <a href="@url">PHP manual</a> for available options. This format is currently set to display as <span>%date</span>.', array('@url' => 'http://php.net/manual/function.date.php', '%date' => format_date($_SERVER['REQUEST_TIME'], 'custom', $default_long_custom))),
);
$form = system_settings_form($form);
@@ -1697,7 +1697,7 @@ function system_date_time_settings_submit($form, &$form_state) {
* Return the date for a given format string via Ajax.
*/
function system_date_time_lookup() {
- $result = format_date(time(), 'custom', $_GET['format']);
+ $result = format_date($_SERVER['REQUEST_TIME'], 'custom', $_GET['format']);
echo drupal_to_js($result);
exit;
}
diff --git a/modules/system/system.install b/modules/system/system.install
index e4d7d8756..e133d55ec 100644
--- a/modules/system/system.install
+++ b/modules/system/system.install
@@ -143,10 +143,10 @@ function system_requirements($phase) {
// Determine severity based on time since cron last ran.
$severity = REQUIREMENT_OK;
- if (time() - $cron_last > $threshold_error) {
+ if ($_SERVER['REQUEST_TIME'] - $cron_last > $threshold_error) {
$severity = REQUIREMENT_ERROR;
}
- else if ($never_run || (time() - $cron_last > $threshold_warning)) {
+ else if ($never_run || ($_SERVER['REQUEST_TIME'] - $cron_last > $threshold_warning)) {
$severity = REQUIREMENT_WARNING;
}
@@ -163,7 +163,7 @@ function system_requirements($phase) {
$description = $t('Cron has not run.') . ' ' . $help;
}
else {
- $summary = $t('Last run !time ago', array('!time' => format_interval(time() - $cron_last)));
+ $summary = $t('Last run !time ago', array('!time' => format_interval($_SERVER['REQUEST_TIME'] - $cron_last)));
$description = '';
if ($severity != REQUIREMENT_OK) {
$description = $t('Cron has not run recently.') . ' ' . $help;
@@ -371,7 +371,7 @@ function system_install() {
// presumed to be a serialized array. Install will change uid 1 immediately
// anyways. So we insert the superuser here, the uid is 2 here for now, but
// very soon it will be changed to 1.
- db_query("INSERT INTO {users} (name, mail, created, data) VALUES('%s', '%s', %d, '%s')", 'placeholder-for-uid-1', 'placeholder-for-uid-1', time(), serialize(array()));
+ db_query("INSERT INTO {users} (name, mail, created, data) VALUES('%s', '%s', %d, '%s')", 'placeholder-for-uid-1', 'placeholder-for-uid-1', $_SERVER['REQUEST_TIME'], serialize(array()));
// This sets the above two users uid 0 (anonymous). We avoid an explicit 0
// otherwise MySQL might insert the next auto_increment value.
db_query("UPDATE {users} SET uid = uid - uid WHERE name = '%s'", '');
diff --git a/modules/system/system.module b/modules/system/system.module
index 005d21a89..9b9791f0f 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1391,12 +1391,12 @@ function system_get_module_admin_tasks($module) {
*/
function system_cron() {
// Cleanup the flood.
- db_query('DELETE FROM {flood} WHERE timestamp < %d', time() - 3600);
+ db_query('DELETE FROM {flood} WHERE timestamp < %d', $_SERVER['REQUEST_TIME'] - 3600);
// Cleanup the batch table.
- db_query('DELETE FROM {batch} WHERE timestamp < %d', time() - 864000);
+ db_query('DELETE FROM {batch} WHERE timestamp < %d', $_SERVER['REQUEST_TIME'] - 864000);
// Remove temporary files that are older than DRUPAL_MAXIMUM_TEMP_FILE_AGE.
- $result = db_query('SELECT * FROM {files} WHERE status = %d and timestamp < %d', FILE_STATUS_TEMPORARY, time() - DRUPAL_MAXIMUM_TEMP_FILE_AGE);
+ $result = db_query('SELECT * FROM {files} WHERE status = %d and timestamp < %d', FILE_STATUS_TEMPORARY, $_SERVER['REQUEST_TIME'] - DRUPAL_MAXIMUM_TEMP_FILE_AGE);
while ($file = db_fetch_object($result)) {
if (file_exists($file->filepath)) {
// If files that exist cannot be deleted, continue so the database remains
@@ -2027,7 +2027,7 @@ function system_block_ip_action() {
* Generate an array of time zones and their local time&date.
*/
function _system_zonelist() {
- $timestamp = time();
+ $timestamp = $_SERVER['REQUEST_TIME'];
$zonelist = array(-11, -10, -9.5, -9, -8, -7, -6, -5, -4, -3.5, -3, -2, -1, 0, 1, 2, 3, 3.5, 4, 5, 5.5, 5.75, 6, 6.5, 7, 8, 9, 9.5, 10, 10.5, 11, 11.5, 12, 12.75, 13, 14);
$zones = array();
foreach ($zonelist as $offset) {
diff --git a/modules/tracker/tracker.pages.inc b/modules/tracker/tracker.pages.inc
index 8b596497e..e66bca68d 100644
--- a/modules/tracker/tracker.pages.inc
+++ b/modules/tracker/tracker.pages.inc
@@ -54,7 +54,7 @@ function tracker_page($account = NULL, $set_title = FALSE) {
l($node->title, "node/$node->nid") . ' ' . theme('mark', node_mark($node->nid, $node->changed)),
theme('username', $node),
array('class' => 'replies', 'data' => $comments),
- t('!time ago', array('!time' => format_interval(time() - $node->last_updated)))
+ t('!time ago', array('!time' => format_interval($_SERVER['REQUEST_TIME'] - $node->last_updated)))
);
}
diff --git a/modules/update/update.compare.inc b/modules/update/update.compare.inc
index e10479cba..efca6e928 100644
--- a/modules/update/update.compare.inc
+++ b/modules/update/update.compare.inc
@@ -30,7 +30,7 @@ function update_get_projects() {
_update_process_info_list($projects, module_rebuild_cache(), 'module');
_update_process_info_list($projects, system_theme_data(), 'theme');
// Set the projects array into the cache table.
- cache_set('update_project_projects', $projects, 'cache_update', time() + 3600);
+ cache_set('update_project_projects', $projects, 'cache_update', $_SERVER['REQUEST_TIME'] + 3600);
}
}
return $projects;
@@ -551,7 +551,7 @@ function update_calculate_project_data($available) {
drupal_alter('update_status', $projects);
// Set the projects array into the cache table.
- cache_set('update_project_data', $projects, 'cache_update', time() + 3600);
+ cache_set('update_project_data', $projects, 'cache_update', $_SERVER['REQUEST_TIME'] + 3600);
return $projects;
}
@@ -588,7 +588,7 @@ function update_project_cache($cid) {
}
else {
$cache = cache_get($cid, 'cache_update');
- if (!empty($cache->data) && $cache->expire > time()) {
+ if (!empty($cache->data) && $cache->expire > $_SERVER['REQUEST_TIME']) {
$projects = $cache->data;
}
}
diff --git a/modules/update/update.fetch.inc b/modules/update/update.fetch.inc
index 17cf06f48..d23370296 100644
--- a/modules/update/update.fetch.inc
+++ b/modules/update/update.fetch.inc
@@ -52,8 +52,8 @@ function _update_refresh() {
}
if (!empty($available) && is_array($available)) {
$frequency = variable_get('update_check_frequency', 1);
- cache_set('update_info', $available, 'cache_update', time() + (60 * 60 * 24 * $frequency));
- variable_set('update_last_check', time());
+ cache_set('update_info', $available, 'cache_update', $_SERVER['REQUEST_TIME'] + (60 * 60 * 24 * $frequency));
+ variable_set('update_last_check', $_SERVER['REQUEST_TIME']);
watchdog('update', 'Fetched information about all available new releases and updates.', array(), WATCHDOG_NOTICE, l(t('view'), 'admin/reports/updates'));
}
else {
diff --git a/modules/update/update.module b/modules/update/update.module
index 8a08f986c..15ca24d25 100644
--- a/modules/update/update.module
+++ b/modules/update/update.module
@@ -276,7 +276,7 @@ function _update_requirement_check($project, $type) {
function update_cron() {
$frequency = variable_get('update_check_frequency', 1);
$interval = 60 * 60 * 24 * $frequency;
- if (time() - variable_get('update_last_check', 0) > $interval) {
+ if ($_SERVER['REQUEST_TIME'] - variable_get('update_last_check', 0) > $interval) {
update_refresh();
_update_cron_notify();
}
@@ -342,7 +342,7 @@ function update_get_available($refresh = FALSE) {
}
}
if (!$needs_refresh && ($cache = cache_get('update_info', 'cache_update'))
- && $cache->expire > time()) {
+ && $cache->expire > $_SERVER['REQUEST_TIME']) {
$available = $cache->data;
}
elseif ($needs_refresh || $refresh) {
diff --git a/modules/update/update.report.inc b/modules/update/update.report.inc
index 152302061..193284f1c 100644
--- a/modules/update/update.report.inc
+++ b/modules/update/update.report.inc
@@ -27,7 +27,7 @@ function update_status() {
*/
function theme_update_report($data) {
$last = variable_get('update_last_check', 0);
- $output = '<div class="update checked">' . ($last ? t('Last checked: @time ago', array('@time' => format_interval(time() - $last))) : t('Last checked: never'));
+ $output = '<div class="update checked">' . ($last ? t('Last checked: @time ago', array('@time' => format_interval($_SERVER['REQUEST_TIME'] - $last))) : t('Last checked: never'));
$output .= ' <span class="check-manually">(' . l(t('Check manually'), 'admin/reports/updates/check') . ')</span>';
$output .= "</div>\n";
diff --git a/modules/user/user.admin.inc b/modules/user/user.admin.inc
index 1760c6e6a..fa188324d 100644
--- a/modules/user/user.admin.inc
+++ b/modules/user/user.admin.inc
@@ -180,8 +180,8 @@ function user_admin_account() {
}
asort($users_roles);
$form['roles'][$account->uid][0] = array('#markup' => theme('item_list', $users_roles));
- $form['member_for'][$account->uid] = array('#markup' => format_interval(time() - $account->created));
- $form['last_access'][$account->uid] = array('#markup' => $account->access ? t('@time ago', array('@time' => format_interval(time() - $account->access))) : t('never'));
+ $form['member_for'][$account->uid] = array('#markup' => format_interval($_SERVER['REQUEST_TIME'] - $account->created));
+ $form['last_access'][$account->uid] = array('#markup' => $account->access ? t('@time ago', array('@time' => format_interval($_SERVER['REQUEST_TIME'] - $account->access))) : t('never'));
$form['operations'][$account->uid] = array('#markup' => l(t('edit'), "user/$account->uid/edit", array('query' => $destination)));
}
$form['accounts'] = array(
diff --git a/modules/user/user.module b/modules/user/user.module
index 5f8b629bd..5d920b8e3 100644
--- a/modules/user/user.module
+++ b/modules/user/user.module
@@ -240,7 +240,7 @@ function user_save($account, $edit = array(), $category = 'account') {
// Consider users edited by an administrator as logged in, if they haven't
// already, so anonymous users can view the profile (if allowed).
if (empty($edit['access']) && empty($account->access) && user_access('administer users')) {
- $edit['access'] = time();
+ $edit['access'] = $_SERVER['REQUEST_TIME'];
}
foreach ($edit as $key => $value) {
// Fields that don't pertain to the users or user_roles
@@ -302,12 +302,12 @@ function user_save($account, $edit = array(), $category = 'account') {
else {
// Allow 'created' to be set by the caller.
if (!isset($edit['created'])) {
- $edit['created'] = time();
+ $edit['created'] = $_SERVER['REQUEST_TIME'];
}
// Consider users created by an administrator as already logged in, so
// anonymous users can view the profile (if allowed).
if (empty($edit['access']) && user_access('administer users')) {
- $edit['access'] = time();
+ $edit['access'] = $_SERVER['REQUEST_TIME'];
}
$success = drupal_write_record('users', $edit);
@@ -653,7 +653,7 @@ function user_user($type, &$edit, &$account, $category = NULL) {
$account->content['summary']['member_for'] = array(
'#type' => 'user_profile_item',
'#title' => t('Member for'),
- '#markup' => format_interval(time() - $account->created),
+ '#markup' => format_interval($_SERVER['REQUEST_TIME'] - $account->created),
);
}
if ($type == 'form' && $category == 'account') {
@@ -788,7 +788,7 @@ function user_block($op = 'list', $delta = '', $edit = array()) {
case 'online':
if (user_access('access content')) {
// Count users active within the defined period.
- $interval = time() - variable_get('user_block_seconds_online', 900);
+ $interval = $_SERVER['REQUEST_TIME'] - variable_get('user_block_seconds_online', 900);
// Perform database queries to gather online user lists. We use s.timestamp
// rather than u.access because it is much faster.
@@ -1341,7 +1341,7 @@ function user_authenticate_finalize(&$edit) {
watchdog('user', 'Session opened for %name.', array('%name' => $user->name));
// Update the user table timestamp noting user has logged in.
// This is also used to invalidate one-time login links.
- $user->login = time();
+ $user->login = $_SERVER['REQUEST_TIME'];
db_query("UPDATE {users} SET login = %d WHERE uid = %d", $user->login, $user->uid);
user_module_invoke('login', $edit, $user);
sess_regenerate();
@@ -1380,7 +1380,7 @@ function user_external_login_register($name, $module) {
'pass' => user_password(),
'init' => $name,
'status' => 1,
- 'access' => time()
+ 'access' => $_SERVER['REQUEST_TIME']
);
$account = user_save('', $userinfo);
// Terminate if an error occured during user_save().
@@ -1395,7 +1395,7 @@ function user_external_login_register($name, $module) {
}
function user_pass_reset_url($account) {
- $timestamp = time();
+ $timestamp = $_SERVER['REQUEST_TIME'];
return url("user/reset/$account->uid/$timestamp/" . user_pass_rehash($account->pass, $timestamp, $account->login), array('absolute' => TRUE));
}
@@ -2040,7 +2040,7 @@ function user_mail_tokens($account, $language) {
'!uri' => $base_url,
'!uri_brief' => preg_replace('!^https?://!', '', $base_url),
'!mailto' => $account->mail,
- '!date' => format_date(time(), 'medium', '', NULL, $language->language),
+ '!date' => format_date($_SERVER['REQUEST_TIME'], 'medium', '', NULL, $language->language),
'!login_uri' => url('user', array('absolute' => TRUE, 'language' => $language)),
'!edit_uri' => url('user/' . $account->uid . '/edit', array('absolute' => TRUE, 'language' => $language)),
);
diff --git a/modules/user/user.pages.inc b/modules/user/user.pages.inc
index df0c37fcc..be757643b 100644
--- a/modules/user/user.pages.inc
+++ b/modules/user/user.pages.inc
@@ -84,7 +84,7 @@ function user_pass_reset(&$form_state, $uid, $timestamp, $hashed_pass, $action =
else {
// Time out, in seconds, until login URL expires. 24 hours = 86400 seconds.
$timeout = 86400;
- $current = time();
+ $current = $_SERVER['REQUEST_TIME'];
// Some redundant checks for extra security ?
if ($timestamp < $current && $account = user_load(array('uid' => $uid, 'status' => 1)) ) {
// No time out for first time login.
diff --git a/modules/user/user.test b/modules/user/user.test
index 17a187a99..57a6a570b 100644
--- a/modules/user/user.test
+++ b/modules/user/user.test
@@ -43,7 +43,7 @@ class UserRegistrationTestCase extends DrupalWebTestCase {
$this->assertEqual($user->mail, $mail, t('E-mail address matches.'));
$this->assertEqual($user->theme, '', t('Correct theme field.'));
$this->assertEqual($user->signature, '', t('Correct signature field.'));
- $this->assertTrue(($user->created > time() - 20 ), t('Correct creation time.'));
+ $this->assertTrue(($user->created > $_SERVER['REQUEST_TIME'] - 20 ), t('Correct creation time.'));
$this->assertEqual($user->status, variable_get('user_register', 1) == 1 ? 1 : 0, t('Correct status field.'));
$this->assertEqual($user->timezone, variable_get('date_default_timezone', NULL), t('Correct timezone field.'));
$this->assertEqual($user->language, '', t('Correct language field.'));