From: Roan Kattouw Date: Mon, 13 Sep 2010 15:14:11 +0000 (+0000) Subject: (bug 25137) Don't open a DB connection just to (wrongly) use $dbr->timestamp() X-Git-Tag: 1.31.0-rc.0~34957 X-Git-Url: http://git.cyclocoop.org/ecrire?a=commitdiff_plain;h=97fa1e5c5bb1507e316be5dab0c179b8c872d4b1;p=lhc%2Fweb%2Fwiklou.git (bug 25137) Don't open a DB connection just to (wrongly) use $dbr->timestamp() --- diff --git a/includes/api/ApiFeedWatchlist.php b/includes/api/ApiFeedWatchlist.php index c54858895f..3cde8dbf77 100644 --- a/includes/api/ApiFeedWatchlist.php +++ b/includes/api/ApiFeedWatchlist.php @@ -62,7 +62,6 @@ 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', @@ -71,7 +70,7 @@ class ApiFeedWatchlist extends ApiBase { 'list' => 'watchlist', 'wlprop' => 'title|user|comment|timestamp', 'wldir' => 'older', // reverse order - from newest to oldest - 'wlend' => $dbr->timestamp( $endTime ), // stop at this time + 'wlend' => wfTimestamp( TS_MW, $endTime ), // stop at this time 'wllimit' => ( 50 > $wgFeedLimit ) ? $wgFeedLimit : 50 );