From f3d2b1f8e654115fb6166484333e2c4489c590f8 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Mon, 21 Jan 2008 19:37:07 +0000 Subject: [PATCH] Convert to the right timestamp format before doing a query --- includes/api/ApiFeedWatchlist.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index 02bbbaa6a1..8c7bf81bc5 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -62,6 +62,7 @@ class ApiFeedWatchlist extends ApiBase { // limit to the number of hours going from now back $endTime = wfTimestamp(TS_MW, time() - intval($params['hours'] * 60 * 60)); + $dbr = wfGetDB( DB_SLAVE ); // Prepare parameters for nested request $fauxReqArr = array ( 'action' => 'query', @@ -70,7 +71,7 @@ class ApiFeedWatchlist extends ApiBase { 'list' => 'watchlist', 'wlprop' => 'title|user|comment|timestamp', 'wldir' => 'older', // reverse order - from newest to oldest - 'wlend' => $endTime, // stop at this time + 'wlend' => $dbr->timestamp($endTime), // stop at this time 'wllimit' => 50 ); -- 2.20.1