From: Alex Monk Date: Fri, 25 Mar 2016 04:17:47 +0000 (+0000) Subject: RightsLogFormatter: Use DB key to generate foreign user link X-Git-Tag: 1.31.0-rc.0~7329^2 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/banques/%7B%7B%20url_for%28%27admin_users%27%29%20%7D%7D?a=commitdiff_plain;h=c6df967e03a09d5c81473e80fe808e2ebb53ec55;p=lhc%2Fweb%2Fwiklou.git RightsLogFormatter: Use DB key to generate foreign user link getText returns a version of the title with spaces instead of underscores, which confuses WikiMap Also show underscore in text displayed to user Bug: T130835 Change-Id: I192e28062590e4602127f895b88328b52018b468 --- diff --git a/includes/logging/RightsLogFormatter.php b/includes/logging/RightsLogFormatter.php index b9dfb6c044..1fd4b7f364 100644 --- a/includes/logging/RightsLogFormatter.php +++ b/includes/logging/RightsLogFormatter.php @@ -33,12 +33,19 @@ class RightsLogFormatter extends LogFormatter { 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;