@@ -903,7 +903,7 @@ function valid_url($url, $absolute = FALSE) {
...
@@ -903,7 +903,7 @@ function valid_url($url, $absolute = FALSE) {
* The name of an event.
* The name of an event.
*/
*/
functionflood_register_event($name){
functionflood_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) {
...
@@ -920,7 +920,7 @@ function flood_register_event($name) {
* True if the user did not exceed the hourly threshold. False otherwise.
* True if the user did not exceed the hourly threshold. False otherwise.
*/
*/
functionflood_is_allowed($name,$threshold){
functionflood_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));
// Change any future last comment timestamps to current time.
// 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',$_SERVER['REQUEST_TIME'],$_SERVER['REQUEST_TIME']);
db_query('UPDATE {node_comment_statistics} SET last_comment_timestamp = %d WHERE last_comment_timestamp > %d',REQUEST_TIME,REQUEST_TIME);