* @since 1.21
*/
class RightsLogFormatter extends LogFormatter {
- protected function makePageLink( Title $title = null, $parameters = array(), $html = null ) {
+ protected function makePageLink( Title $title = null, $parameters = [], $html = null ) {
global $wgContLang, $wgUserrightsInterwikiDelimiter;
if ( !$this->plaintext ) {
- $text = $wgContLang->ucfirst( $title->getText() );
+ $text = $wgContLang->ucfirst( $title->getDBkey() );
$parts = explode( $wgUserrightsInterwikiDelimiter, $text, 2 );
if ( count( $parts ) === 2 ) {
- $titleLink = WikiMap::foreignUserLink( $parts[1], $parts[0],
- htmlspecialchars( $title->getText() ) );
+ $titleLink = WikiMap::foreignUserLink(
+ $parts[1],
+ $parts[0],
+ htmlspecialchars(
+ strtr( $parts[0], '_', ' ' ) .
+ $wgUserrightsInterwikiDelimiter .
+ $parts[1]
+ )
+ );
if ( $titleLink !== false ) {
return $titleLink;
$key = parent::getMessageKey();
$params = $this->getMessageParameters();
if ( !isset( $params[3] ) && !isset( $params[4] ) ) {
+ // Messages: logentry-rights-rights-legacy
$key .= '-legacy';
}
$params[3] = $this->msg( 'rightsnone' )->text();
}
if ( count( $newGroups ) ) {
- // Array_values is used here because of bug 42211
+ // Array_values is used here because of T44211
// see use of array_unique in UserrightsPage::doSaveUserGroups on $newGroups.
$params[4] = $lang->listToText( array_values( $newGroups ) );
} else {
$params[4] = $this->msg( 'rightsnone' )->text();
}
+ $params[5] = $userName;
+
return $params;
}
$entry = $this->entry;
$params = $entry->getParameters();
- static $map = array(
+ static $map = [
'4:array:oldgroups',
'5:array:newgroups',
'4::oldgroups' => '4:array:oldgroups',
'5::newgroups' => '5:array:newgroups',
- );
+ ];
foreach ( $map as $index => $key ) {
if ( isset( $params[$index] ) ) {
$params[$key] = $params[$index];
private function makeGroupArray( $group ) {
// Migrate old group params from string to array
if ( $group === '' ) {
- $group = array();
+ $group = [];
} elseif ( is_string( $group ) ) {
$group = array_map( 'trim', explode( ',', $group ) );
}