global $wgLogActionsHandlers;
$fulltype = $entry->getFullType();
$wildcard = $entry->getType() . '/*';
- $handler = '';
-
- if ( isset( $wgLogActionsHandlers[$fulltype] ) ) {
- $handler = $wgLogActionsHandlers[$fulltype];
- } elseif ( isset( $wgLogActionsHandlers[$wildcard] ) ) {
- $handler = $wgLogActionsHandlers[$wildcard];
- }
+ $handler = $wgLogActionsHandlers[$fulltype] ?? $wgLogActionsHandlers[$wildcard] ?? '';
if ( $handler !== '' && is_string( $handler ) && class_exists( $handler ) ) {
return new $handler( $entry );
* @return string Text
*/
public function getIRCActionText() {
- global $wgContLang;
-
$this->plaintext = true;
$this->irctext = true;
// Text of title the action is aimed at.
$target = $entry->getTarget()->getPrefixedText();
$text = null;
+ $contLang = MediaWikiServices::getInstance()->getContentLanguage();
switch ( $entry->getType() ) {
case 'move':
switch ( $entry->getSubtype() ) {
$rawDuration = $parameters['5::duration'];
$rawFlags = $parameters['6::flags'];
}
- $duration = $wgContLang->translateBlockExpiry(
+ $duration = $contLang->translateBlockExpiry(
$rawDuration,
null,
wfTimestamp( TS_UNIX, $entry->getTimestamp() )
);
- $flags = BlockLogFormatter::formatBlockFlags( $rawFlags, $wgContLang );
+ $flags = BlockLogFormatter::formatBlockFlags( $rawFlags, $contLang );
$text = wfMessage( 'blocklogentry' )
->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
break;
->rawParams( $target )->inContentLanguage()->escaped();
break;
case 'reblock':
- $duration = $wgContLang->translateBlockExpiry(
+ $duration = $contLang->translateBlockExpiry(
$parameters['5::duration'],
null,
wfTimestamp( TS_UNIX, $entry->getTimestamp() )
);
- $flags = BlockLogFormatter::formatBlockFlags( $parameters['6::flags'], $wgContLang );
+ $flags = BlockLogFormatter::formatBlockFlags( $parameters['6::flags'],
+ $contLang );
$text = wfMessage( 'reblock-logentry' )
->rawParams( $target, $duration, $flags )->inContentLanguage()->escaped();
break;