r72905 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r72904‎ | r72905 | r72906 >
Date:15:14, 13 September 2010
Author:catrope
Status:resolved (Comments)
Tags:
Comment:
(bug 25137) Don't open a DB connection just to (wrongly) use $dbr->timestamp()
Modified paths:
  • /trunk/phase3/includes/api/ApiFeedWatchlist.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/api/ApiFeedWatchlist.php
@@ -62,7 +62,6 @@
6363 // limit to the number of hours going from now back
6464 $endTime = wfTimestamp( TS_MW, time() - intval( $params['hours'] * 60 * 60 ) );
6565
66 - $dbr = wfGetDB( DB_SLAVE );
6766 // Prepare parameters for nested request
6867 $fauxReqArr = array(
6968 'action' => 'query',
@@ -71,7 +70,7 @@
7271 'list' => 'watchlist',
7372 'wlprop' => 'title|user|comment|timestamp',
7473 'wldir' => 'older', // reverse order - from newest to oldest
75 - 'wlend' => $dbr->timestamp( $endTime ), // stop at this time
 74+ 'wlend' => wfTimestamp( TS_MW, $endTime ), // stop at this time
7675 'wllimit' => ( 50 > $wgFeedLimit ) ? $wgFeedLimit : 50
7776 );
7877

Follow-up revisions

RevisionCommit summaryAuthorDate
r74837Fix r72905: don't run $endTime through wfTimestamp() twicecatrope16:53, 16 October 2010

Comments

#Comment by Bryan (talk | contribs)   19:12, 12 October 2010

$endTime is already in TS_MW format.

#Comment by Catrope (talk | contribs)   16:53, 16 October 2010

Good catch. Fixed in r74837.

Status & tagging log