mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/AbuseFilter.git
synced 2024-12-01 00:56:26 +00:00
cba29fe85b
Bug: T247173 Change-Id: I40aa888bc45d8274d03eb7ead7bedaf1d087fb1c
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
|
|
class AbuseFilterRightsLogFormatter extends LogFormatter {
|
|
|
|
/**
|
|
* This method is identical to the parent, but it's redeclared to give grep a chance
|
|
* to find the messages.
|
|
* @inheritDoc
|
|
*/
|
|
protected function getMessageKey() {
|
|
$subtype = $this->entry->getSubtype();
|
|
// Messages that can be used here:
|
|
// * logentry-rights-blockautopromote
|
|
// * logentry-rights-restoreautopromote
|
|
return "logentry-rights-$subtype";
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function extractParameters() {
|
|
$ret = [];
|
|
$ret[3] = $this->entry->getTarget()->getText();
|
|
if ( $this->entry->getSubType() === 'blockautopromote' ) {
|
|
$parameters = $this->entry->getParameters();
|
|
$duration = $parameters['7::duration'];
|
|
$ret[4] = $this->context->getLanguage()->formatDuration( $duration );
|
|
}
|
|
return $ret;
|
|
}
|
|
|
|
/**
|
|
* @inheritDoc
|
|
*/
|
|
protected function getMessageParameters() {
|
|
$params = parent::getMessageParameters();
|
|
// remove "User:" prefix
|
|
$params[2] = $this->formatParameterValue( 'user-link', $this->entry->getTarget()->getText() );
|
|
return $params;
|
|
}
|
|
|
|
}
|