summaryrefslogtreecommitdiff
path: root/includes/common.inc
diff options
context:
space:
mode:
Diffstat (limited to 'includes/common.inc')
-rw-r--r--includes/common.inc14
1 files changed, 7 insertions, 7 deletions
diff --git a/includes/common.inc b/includes/common.inc
index dae0b0d61..be43d6638 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -873,7 +873,7 @@ function valid_url($url, $absolute = FALSE) {
* The name of an event.
*/
function flood_register_event($name) {
- db_query("INSERT INTO {flood} (event, hostname, timestamp) VALUES ('%s', '%s', %d)", $name, ip_address(), time());
+ db_query("INSERT INTO {flood} (event, hostname, timestamp) VALUES ('%s', '%s', %d)", $name, ip_address(), $_SERVER['REQUEST_TIME']);
}
/**
@@ -890,7 +890,7 @@ function flood_register_event($name) {
* True if the user did not exceed the hourly threshold. False otherwise.
*/
function flood_is_allowed($name, $threshold) {
- $number = db_result(db_query("SELECT COUNT(*) FROM {flood} WHERE event = '%s' AND hostname = '%s' AND timestamp > %d", $name, ip_address(), time() - 3600));
+ $number = db_result(db_query("SELECT COUNT(*) FROM {flood} WHERE event = '%s' AND hostname = '%s' AND timestamp > %d", $name, ip_address(), $_SERVER['REQUEST_TIME'] - 3600));
return ($number < $threshold ? TRUE : FALSE);
}
@@ -2074,7 +2074,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
// browser-caching. The string changes on every update or full cache
// flush, forcing browsers to load a new copy of the files, as the
// URL changed. Files that should not be cached (see drupal_add_js())
- // get time() as query-string instead, to enforce reload on every
+ // get $_SERVER['REQUEST_TIME'] as query-string instead, to enforce reload on every
// page request.
$query_string = '?' . substr(variable_get('css_js_query_string', '0'), 0, 1);
@@ -2101,7 +2101,7 @@ function drupal_get_js($scope = 'header', $javascript = NULL) {
// Additionally, go through any remaining scripts if JS preprocessing is on and output the non-cached ones.
foreach ($data as $path => $info) {
if (!$info['preprocess'] || !$is_writable || !$preprocess_js) {
- $no_preprocess[$type] .= '<script type="text/javascript"' . ($info['defer'] ? ' defer="defer"' : '') . ' src="' . base_path() . $path . ($info['cache'] ? $query_string : '?' . time()) . "\"></script>\n";
+ $no_preprocess[$type] .= '<script type="text/javascript"' . ($info['defer'] ? ' defer="defer"' : '') . ' src="' . base_path() . $path . ($info['cache'] ? $query_string : '?' . $_SERVER['REQUEST_TIME']) . "\"></script>\n";
}
else {
$files[$path] = $info;
@@ -2553,7 +2553,7 @@ function drupal_cron_run() {
$semaphore = variable_get('cron_semaphore', FALSE);
if ($semaphore) {
- if (time() - $semaphore > 3600) {
+ if ($_SERVER['REQUEST_TIME'] - $semaphore > 3600) {
// Either cron has been running for more than an hour or the semaphore
// was not reset due to a database error.
watchdog('cron', 'Cron has been running for more than an hour and is most likely stuck.', array(), WATCHDOG_ERROR);
@@ -2571,13 +2571,13 @@ function drupal_cron_run() {
register_shutdown_function('drupal_cron_cleanup');
// Lock cron semaphore
- variable_set('cron_semaphore', time());
+ variable_set('cron_semaphore', $_SERVER['REQUEST_TIME']);
// Iterate through the modules calling their cron handlers (if any):
module_invoke_all('cron');
// Record cron time
- variable_set('cron_last', time());
+ variable_set('cron_last', $_SERVER['REQUEST_TIME']);
watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);
// Release cron semaphore