From: Aaron Schulz Date: Mon, 21 Jan 2008 19:37:07 +0000 (+0000) Subject: Convert to the right timestamp format before doing a query X-Git-Tag: 1.31.0-rc.0~49860 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=f3d2b1f8e654115fb6166484333e2c4489c590f8;p=lhc%2Fweb%2Fwiklou.git Convert to the right timestamp format before doing a query --- 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 );