r82755 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r82754‎ | r82755 | r82756 >
Date:23:04, 24 February 2011
Author:aaron
Status:resolved
Tags:
Comment:
Fixed timestamp use in getAverageRating
Modified paths:
  • /trunk/extensions/ReaderFeedback/ReaderFeedback.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/ReaderFeedback/ReaderFeedback.class.php
@@ -89,6 +89,8 @@
9090 public static function getAverageRating( $article, $tag, $forUpdate=false ) {
9191 global $wgFeedbackAge;
9292 $cutoff_unixtime = time() - $wgFeedbackAge;
 93+ // rfh_date is always MW format on all dbms
 94+ $encCutoff = $db->addQuotes( wfTimestamp( TS_MW, $cutoff_unixtime ) );
9395 $db = $forUpdate ? wfGetDB( DB_MASTER ) : wfGetDB( DB_SLAVE );
9496 $row = $db->selectRow( 'reader_feedback_history',
9597 array('SUM(rfh_total)/SUM(rfh_count) AS ave, SUM(rfh_count) AS count'),

Follow-up revisions

RevisionCommit summaryAuthorDate
r82756Follow-up r82755: actually use $encCutoffaaron23:05, 24 February 2011
r82759Follow-up r82755: *sigh*...was testing the wrong code path, no wonderaaron23:07, 24 February 2011
r85033MFT more extension revs: r82601, r82654, r82698, r82755, r82756, r82759, r829...demon18:49, 30 March 2011

Status & tagging log