mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-11-24 06:03:49 +00:00
Merge "Let AbuseFilter work with 1.19"
This commit is contained in:
commit
a885db279d
|
@ -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;
|
||||
|
|
|
@ -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'];
|
||||
|
|
Loading…
Reference in a new issue