Convert to the right timestamp format before doing a query
authorAaron Schulz <aaron@users.mediawiki.org>
Mon, 21 Jan 2008 19:37:07 +0000 (19:37 +0000)
committerAaron Schulz <aaron@users.mediawiki.org>
Mon, 21 Jan 2008 19:37:07 +0000 (19:37 +0000)
includes/api/ApiFeedWatchlist.php

index 02bbbaa..8c7bf81 100644 (file)
@@ -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
                        );