Page MenuHomeWickedGov Phorge

PermissionChangeLogFormatter.php
No OneTemporary

Size
1 KB
Referenced Files
None
Subscribers
None

PermissionChangeLogFormatter.php

<?php
namespace MediaWiki\Extension\CentralAuth\LogFormatter;
use MediaWiki\Logging\LogFormatter;
/**
* Handles the following log types:
* - gblrights/groupperms
* - gblrights/groupprms2
* Messages used here:
* - logentry-gblrights-groupperms
* - logentry-gblrights-groupprms2
*/
class PermissionChangeLogFormatter extends LogFormatter {
private function makeRightsList( array $ids ): string {
return $ids !== []
? $this->formatParameterValue( 'list', $ids )
: $this->msg( 'rightsnone' )->text();
}
/** @inheritDoc */
protected function extractParameters() {
if ( $this->entry->getSubtype() === 'groupprms2' ) {
if ( $this->entry->isLegacy() ) {
return parent::extractParameters();
}
[ 'addRights' => $addRights, 'removeRights' => $removeRights ] = $this->entry->getParameters();
return [
3 => $this->makeRightsList( $addRights ),
4 => $this->makeRightsList( $removeRights ),
];
} else {
$params = parent::extractParameters();
$oldRights = $params[3] === '(none)' ? [] : explode( ', ', $params[3] );
$newRights = $params[4] === '(none)' ? [] : explode( ', ', $params[4] );
return [
// False positive
// @phan-suppress-next-line SecurityCheck-XSS
3 => $this->makeRightsList( $oldRights ),
// False positive
// @phan-suppress-next-line SecurityCheck-XSS
4 => $this->makeRightsList( $newRights ),
];
}
}
}

File Metadata

Mime Type
text/x-php
Expires
Oct 2 2026, 19:01 (6 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
24/9c/dd88eb9351999b0ef08202ea51c3
Default Alt Text
PermissionChangeLogFormatter.php (1 KB)

Event Timeline