From 7d43968968ed80c755320996ba60cd667b859b38 Mon Sep 17 00:00:00 2001 From: "Mr. E23" Date: Wed, 28 Jan 2004 14:41:20 +0000 Subject: [PATCH] Cutoff on midnight always, making successive queries identical. This means it can take advantage of the mysql query cache. --- includes/SpecialRecentchanges.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/includes/SpecialRecentchanges.php b/includes/SpecialRecentchanges.php index 986c389f75..001f936f0d 100644 --- a/includes/SpecialRecentchanges.php +++ b/includes/SpecialRecentchanges.php @@ -41,7 +41,9 @@ function wfSpecialRecentchanges( $par ) $days = (int)$days; list( $limit, $offset ) = wfCheckLimits( 100, "rclimit" ); $now = wfTimestampNow(); - $cutoff = wfUnix2Timestamp( time() - ( $days * 86400 ) ); + $cutoff_unixtime = time() - ( $days * 86400 ); + $cutoff_unixtime = $cutoff_unixtime - ($cutoff_unixtime % 86400); + $cutoff = wfUnix2Timestamp( $cutoff_unixtime ); if(preg_match('/^[0-9]{14}$/', $from) and $from > $cutoff) { $cutoff = $from; } else { -- 2.20.1