r40618 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r40617‎ | r40618 | r40619 >
Date:21:31, 8 September 2008
Author:aaron
Status:old
Tags:
Comment:
Allow autopromotion for users with NULL registration timestamps (bug 15524)
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.hooks.php
@@ -806,9 +806,9 @@
807807 }
808808 # Check basic, already available, promotion heuristics first...
809809 $now = time();
810 - $usercreation = wfTimestamp( TS_UNIX, $user->getRegistration() );
811 - $userage = floor(($now - $usercreation) / 86400);
812 - if( $userage < $wgFlaggedRevsAutopromote['days'] ) {
 810+ $usercreation = wfTimestampOrNull( TS_UNIX, $user->getRegistration() );
 811+ $userage = $usercreation ? floor(($now - $usercreation) / 86400) : NULL;
 812+ if( !is_null($userage) && $userage < $wgFlaggedRevsAutopromote['days'] ) {
813813 wfProfileOut( __METHOD__ );
814814 return true;
815815 }