r56549 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56548‎ | r56549 | r56550 >
Date:17:55, 17 September 2009
Author:siebrand
Status:reverted (Comments)
Tags:
Comment:
* process messages with escapenoentities instead of escape to allow for example • as pipe-separator
* change string explode to array
* remove hard coded parentheses
* break long lists of parameters
Modified paths:
  • /trunk/phase3/includes/specials/SpecialContributions.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialContributions.php
@@ -226,11 +226,21 @@
227227 $links = $wgLang->pipeList( $tools );
228228
229229 // Show a note if the user is blocked and display the last block log entry.
230 - if ( User::newFromID( $id )->isBlocked() )
231 - LogEventsList::showLogExtract( $wgOut, 'block', $nt->getPrefixedText(), '',
232 - array( 'lim' => 1, 'showIfEmpty' => false, 'msgKey' => array( 'sp-contributions-blocked-notice' ) ) );
 230+ if ( User::newFromID( $id )->isBlocked() ) {
 231+ LogEventsList::showLogExtract(
 232+ $wgOut,
 233+ 'block',
 234+ $nt->getPrefixedText(),
 235+ '',
 236+ array(
 237+ 'lim' => 1,
 238+ 'showIfEmpty' => false,
 239+ 'msgKey' => array( 'sp-contributions-blocked-notice' )
 240+ )
 241+ );
 242+ }
233243 }
234 -
 244+
235245 // Old message 'contribsub' had one parameter, but that doesn't work for
236246 // languages that want to put the "for" bit right after $user but before
237247 // $links. If 'contribsub' is around, use it for reverse compatibility,
@@ -418,9 +428,13 @@
419429
420430 function __construct( $target, $namespace = false, $year = false, $month = false, $tagFilter = false ) {
421431 parent::__construct();
422 - foreach( explode( ' ', 'uctop diff newarticle rollbacklink diff hist rev-delundel pipe-separator' ) as $msg ) {
423 - $this->messages[$msg] = wfMsgExt( $msg, array( 'escape') );
 432+
 433+ $msgs = array( 'uctop', 'diff', 'newarticle', 'rollbacklink', 'diff', 'hist', 'rev-delundel', 'pipe-separator' );
 434+
 435+ foreach( $msgs as $msg ) {
 436+ $this->messages[$msg] = wfMsgExt( $msg, 'escapenoentities' );
424437 }
 438+
425439 $this->target = $target;
426440 $this->namespace = $namespace;
427441 $this->tagFilter = $tagFilter;
@@ -461,14 +475,16 @@
462476 'options' => array( 'USE INDEX' => array('revision' => $index) ),
463477 'join_conds' => $join_cond
464478 );
465 -
466 - ChangeTags::modifyDisplayQuery( $queryInfo['tables'],
467 - $queryInfo['fields'],
468 - $queryInfo['conds'],
469 - $queryInfo['join_conds'],
470 - $queryInfo['options'],
471 - $this->tagFilter );
472 -
 479+
 480+ ChangeTags::modifyDisplayQuery(
 481+ $queryInfo['tables'],
 482+ $queryInfo['fields'],
 483+ $queryInfo['conds'],
 484+ $queryInfo['join_conds'],
 485+ $queryInfo['options'],
 486+ $this->tagFilter
 487+ );
 488+
473489 wfRunHooks( 'ContribsPager::getQueryInfo', array( &$this, &$queryInfo ) );
474490 return $queryInfo;
475491 }
@@ -543,12 +559,13 @@
544560 if( $row->rev_id == $row->page_latest ) {
545561 $topmarktext .= '<span class="mw-uctop">' . $this->messages['uctop'] . '</span>';
546562 if( !$row->page_is_new ) {
547 - $difftext .= '(' . $sk->linkKnown(
 563+ $difflink = $sk->linkKnown(
548564 $page,
549565 $this->messages['diff'],
550566 array(),
551567 array( 'diff' => 0 )
552 - ) . ')';
 568+ );
 569+ $difftext .= wfMsg( 'parentheses', $difflink );
553570 # Add rollback link
554571 if( $page->quickUserCan( 'rollback') && $page->quickUserCan( 'edit' ) ) {
555572 $topmarktext .= ' '.$sk->generateRollback( $rev );
@@ -593,7 +610,7 @@
594611
595612 if( $this->target == 'newbies' ) {
596613 $userlink = ' . . ' . $sk->userLink( $row->rev_user, $row->rev_user_text );
597 - $userlink .= ' (' . $sk->userTalkLink( $row->rev_user, $row->rev_user_text ) . ') ';
 614+ $userlink .= ' ' . wfMsgExt( 'parentheses', 'escapenoentities', $sk->userTalkLink( $row->rev_user, $row->rev_user_text ) ) . ' ';
598615 } else {
599616 $userlink = '';
600617 }
@@ -614,7 +631,7 @@
615632 // If revision was hidden from sysops
616633 if( !$rev->userCan( Revision::DELETED_RESTRICTED ) ) {
617634 $del = Xml::tags( 'span', array( 'class'=>'mw-revdelundel-link' ),
618 - '(' . $this->messages['rev-delundel'] . ')' ) . ' ';
 635+ wfMsg( 'parentheses', $this->messages['rev-delundel'] ) ) . ' ';
619636 // Otherwise, show the link...
620637 } else {
621638 $query = array(

Follow-up revisions

RevisionCommit summaryAuthorDate
r57489Partial revert r56549 -- too much HTML escaping on user tools links for /newb...brion21:24, 7 October 2009
r57490merge trunk r57489 -- partial revert of r56549 -- undo incorrect escaping on ...brion21:26, 7 October 2009
r57497Partial reapply of r56549 after revert in r57489 without the incorrect escaping.siebrand21:53, 7 October 2009

Comments

#Comment by Siebrand (talk | contribs)   21:47, 7 October 2009

That was not a partial revert, but a full revert. Incorrect commit message, or incorrect commit?

Status & tagging log