Merge "Let AbuseFilter work with 1.19"

This commit is contained in:
Hoo man 2013-01-09 01:42:29 +00:00 committed by Gerrit Code Review
commit a885db279d
2 changed files with 3 additions and 8 deletions

View file

@ -1487,8 +1487,7 @@ class AbuseFilter {
$matchCount++;
// Figure out if the filter is subject to being deleted.
$ts = new MWTimestamp( self::$filters[$filter]->af_timestamp );
$filter_age = $ts->getTimestamp( TS_UNIX );
$filter_age = wfTimestamp( TS_UNIX, self::$filters[$filter]->af_timestamp );
$throttle_exempt_time = $filter_age + $emergencyDisableAge;
if ( $total && $throttle_exempt_time > time()
@ -1768,9 +1767,8 @@ class AbuseFilter {
return null;
}
if ( $vars ) {
$ts = new MWTimestamp( $row->rc_timestamp );
$vars->setVar( 'context', 'generated' );
$vars->setVar( 'timestamp', $ts->getTimestamp( TS_UNIX ) );
$vars->setVar( 'timestamp', wfTimestamp( TS_UNIX, $row->rc_timestamp ) );
}
return $vars;

View file

@ -421,10 +421,7 @@ class AFComputedVariable {
}
$registration = $obj->getRegistration();
$ts = new MWTimestamp( $asOf );
$result =
$ts->getTimestamp( TS_UNIX ) -
wfTimestampOrNull( TS_UNIX, $registration );
$result = wfTimestamp( TS_UNIX, $asOf ) - wfTimestampOrNull( TS_UNIX, $registration );
break;
case 'user-groups':
$user = $parameters['user'];