mediawiki-extensions-AbuseF.../includes/AbuseFilterModifyLogFormatter.php
MarcoAurelio 59ff4aed5d Actually mark abusefilter creations as such in the AbuseFilter log
Bug: T178283
Co-Authored-By: Matěj Suchánek <matejsuchanek97@gmail.com>
Change-Id: I89776eff2fc420b1fe3e2c3b88671749fadb57b4
2018-01-12 17:03:13 +00:00

54 lines
1.1 KiB
PHP

<?php
class AbuseFilterModifyLogFormatter extends LogFormatter {
/**
* @return string
*/
protected function getMessageKey() {
$subtype = $this->entry->getSubtype();
// Messages that can be used here:
// * abusefilter-logentry-create
// * abusefilter-logentry-modify
return "abusefilter-logentry-$subtype";
}
/**
* @return array
*/
protected function extractParameters() {
$parameters = $this->entry->getParameters();
if ( $this->entry->isLegacy() ) {
list( $historyId, $filterId ) = $parameters;
} else {
$historyId = $parameters['historyId'];
$filterId = $parameters['newId'];
}
$detailsTitle = SpecialPage::getTitleFor(
'AbuseFilter',
"history/$filterId/diff/prev/$historyId"
);
$params = [];
$params[3] = Message::rawParam(
$this->makePageLink(
$this->entry->getTarget(),
[],
$this->msg( 'abusefilter-log-detailedentry-local' )
->numParams( $filterId )->escaped()
)
);
$params[4] = Message::rawParam(
$this->makePageLink(
$detailsTitle,
[],
$this->msg( 'abusefilter-log-detailslink' )->escaped()
)
);
return $params;
}
}