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 69227435e..2336e5fda 100644
--- a/includes/common.inc
+++ b/includes/common.inc
@@ -903,7 +903,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(), $_SERVER['REQUEST_TIME']);
+ db_query("INSERT INTO {flood} (event, hostname, timestamp) VALUES ('%s', '%s', %d)", $name, ip_address(), REQUEST_TIME);
}
/**
@@ -920,7 +920,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(), $_SERVER['REQUEST_TIME'] - 3600));
+ $number = db_result(db_query("SELECT COUNT(*) FROM {flood} WHERE event = '%s' AND hostname = '%s' AND timestamp > %d", $name, ip_address(), REQUEST_TIME - 3600));
return ($number < $threshold ? TRUE : FALSE);
}
@@ -2104,7 +2104,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 $_SERVER['REQUEST_TIME'] as query-string instead, to enforce reload on every
+ // get 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);
@@ -2131,7 +2131,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 : '?' . $_SERVER['REQUEST_TIME']) . "\"></script>\n";
+ $no_preprocess[$type] .= '<script type="text/javascript"' . ($info['defer'] ? ' defer="defer"' : '') . ' src="' . base_path() . $path . ($info['cache'] ? $query_string : '?' . REQUEST_TIME) . "\"></script>\n";
}
else {
$files[$path] = $info;
@@ -2583,7 +2583,7 @@ function drupal_cron_run() {
$semaphore = variable_get('cron_semaphore', FALSE);
if ($semaphore) {
- if ($_SERVER['REQUEST_TIME'] - $semaphore > 3600) {
+ if (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);
@@ -2601,13 +2601,13 @@ function drupal_cron_run() {
register_shutdown_function('drupal_cron_cleanup');
// Lock cron semaphore
- variable_set('cron_semaphore', $_SERVER['REQUEST_TIME']);
+ variable_set('cron_semaphore', REQUEST_TIME);
// Iterate through the modules calling their cron handlers (if any):
module_invoke_all('cron');
// Record cron time
- variable_set('cron_last', $_SERVER['REQUEST_TIME']);
+ variable_set('cron_last', REQUEST_TIME);
watchdog('cron', 'Cron run completed.', array(), WATCHDOG_NOTICE);
// Release cron semaphore