r101253 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r101252‎ | r101253 | r101254 >
Date:11:19, 29 October 2011
Author:petrb
Status:deferred
Tags:
Comment:
fixed the calculation of timestamp
Modified paths:
  • /trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/OnlineStatusBar/OnlineStatusBar.body.php
@@ -173,8 +173,9 @@
174174 public static function DeleteOld() {
175175 global $wgOnlineStatusBar_LogoutTime;
176176 $dbw = wfGetDB( DB_MASTER );
177 - $time = $dbw->timestamp() - $wgOnlineStatusBar_LogoutTime;
178 - $dbw->delete( 'online_status', array( "timestamp < " . $dbw->addQuotes( $time ) ), __METHOD__ );
 177+ // calculate time and convert it back to mediawiki format
 178+ $time = wfTimestamp( TS_UNIX ) - $wgOnlineStatusBar_LogoutTime;
 179+ $dbw->delete( 'online_status', array( "timestamp < " . $dbw->addQuotes( $dbw->timestamp( $time ) ) ), __METHOD__ );
179180 return 0;
180181 }
181182

Status & tagging log