r104347 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r104346‎ | r104347 | r104348 >
Date:17:20, 27 November 2011
Author:robin
Status:resolved
Tags:
Comment:
* (bug 23280) Show servername instead of dbname for home wiki on Special:CentralAuth, for consistency with wiki list (Needed to move html escaping to different places for that).
* Also change paragraphs to a more logical <ul> list.
Modified paths:
  • /trunk/extensions/CentralAuth/specials/SpecialCentralAuth.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralAuth/specials/SpecialCentralAuth.php
@@ -292,18 +292,19 @@
293293 $age = $this->prettyTimespan( wfTimestamp( TS_UNIX ) - wfTimestamp( TS_UNIX, $reg ) );
294294 $attribs = array(
295295 'id' => $globalUser->getId(),
296 - 'registered' => $wgLang->timeanddate( $reg, true ) . " ($age)",
 296+ 'registered' => htmlspecialchars( $wgLang->timeanddate( $reg, true ) . " ($age)" ),
297297 'home' => $this->determineHomeWiki(),
298 - 'editcount' => $wgLang->formatNum( $this->evaluateTotalEditcount() ),
299 - 'locked' => $globalUser->isLocked() ? wfMsg( 'centralauth-admin-yes' ) : wfMsg( 'centralauth-admin-no' ),
300 - 'hidden' => $this->formatHiddenLevel( $globalUser->getHiddenLevel() ) );
 298+ 'editcount' => htmlspecialchars( $wgLang->formatNum( $this->evaluateTotalEditcount() ) ),
 299+ 'locked' => wfMsgHtml( $globalUser->isLocked() ? 'centralauth-admin-yes' : 'centralauth-admin-no' ),
 300+ 'hidden' => $this->formatHiddenLevel( $globalUser->getHiddenLevel() )
 301+ );
301302 $out = '<fieldset id="mw-centralauth-info">';
302 - $out .= '<legend>' . wfMsgHtml( 'centralauth-admin-info-header' ) . '</legend>';
 303+ $out .= '<legend>' . wfMsgHtml( 'centralauth-admin-info-header' ) . '</legend><ul>';
303304 foreach ( $attribs as $tag => $data ) {
304 - $out .= '<p><strong>' . wfMsgHtml( "centralauth-admin-info-$tag" ) . '</strong> ' .
305 - htmlspecialchars( $data ) . '</p>';
 305+ $out .= '<li><strong>' . wfMsgHtml( "centralauth-admin-info-$tag" ) . '</strong> ' .
 306+ $data . '</li>';
306307 }
307 - $out .= '</fieldset>';
 308+ $out .= '</ul></fieldset>';
308309 $wgOut->addHTML( $out );
309310 }
310311
@@ -493,11 +494,11 @@
494495 function formatHiddenLevel( $level ) {
495496 switch( $level ) {
496497 case CentralAuthUser::HIDDEN_NONE:
497 - return wfMsg( 'centralauth-admin-no' );
 498+ return wfMsgHtml( 'centralauth-admin-no' );
498499 case CentralAuthUser::HIDDEN_LISTS:
499 - return wfMsg( 'centralauth-admin-hidden-list' );
 500+ return wfMsgHtml( 'centralauth-admin-hidden-list' );
500501 case CentralAuthUser::HIDDEN_OVERSIGHT:
501 - return wfMsg( 'centralauth-admin-hidden-oversight' );
 502+ return wfMsgHtml( 'centralauth-admin-hidden-oversight' );
502503 }
503504 return '';
504505 }
@@ -697,7 +698,7 @@
698699 function determineHomeWiki() {
699700 foreach ( $this->mAttachedLocalAccounts as $wiki => $acc ) {
700701 if ( $acc['attachedMethod'] == 'primary' || $acc['attachedMethod'] == 'new' ) {
701 - return $wiki;
 702+ return self::foreignUserLink( $wiki );
702703 }
703704 }
704705

Follow-up revisions

RevisionCommit summaryAuthorDate
r104349follow-up r104347: doesn't seem to change anything, but no other function in ...robin17:27, 27 November 2011

Status & tagging log