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