r83758 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r83757‎ | r83758 | r83759 >
Date:13:45, 12 March 2011
Author:ialex
Status:ok
Tags:
Comment:
Use Html::element() to generate the element; the url and the title attribute are now build only when really necessary
Modified paths:
  • /trunk/phase3/includes/diff/DifferenceEngine.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/diff/DifferenceEngine.php
@@ -1027,15 +1027,15 @@
10281028 $this->mOldtitle = "<a href='$oldLink'>{$this->mOldPagetitle}</a>"
10291029 . " (<a href='$oldEdit'>" . wfMsgHtml( $editable ? 'editold' : 'viewsourceold' ) . "</a>)";
10301030 // Add an "undo" link
1031 - $newUndo = $this->mNewPage->escapeLocalUrl( array(
1032 - 'action' => 'edit',
1033 - 'undoafter' => $this->mOldid,
1034 - 'undo' => $this->mNewid
1035 - ) );
1036 - $htmlLink = htmlspecialchars( wfMsg( 'editundo' ) );
1037 - $htmlTitle = Xml::expandAttributes( array( 'title' => $wgUser->getSkin()->titleAttrib( 'undo' ) ) );
10381031 if ( $editable && !$this->mOldRev->isDeleted( Revision::DELETED_TEXT ) && !$this->mNewRev->isDeleted( Revision::DELETED_TEXT ) ) {
1039 - $this->mNewtitle .= " (<a href='$newUndo' $htmlTitle>" . $htmlLink . "</a>)";
 1032+ $undoLink = Html::element( 'a', array(
 1033+ 'href' => $this->mNewPage->getLocalUrl( array(
 1034+ 'action' => 'edit',
 1035+ 'undoafter' => $this->mOldid,
 1036+ 'undo' => $this->mNewid ) ),
 1037+ 'title' => $wgUser->getSkin()->titleAttrib( 'undo' )
 1038+ ), wfMsg( 'editundo' ) );
 1039+ $this->mNewtitle .= ' (' . $undoLink . ')';
10401040 }
10411041
10421042 if ( !$this->mOldRev->userCan( Revision::DELETED_TEXT ) ) {

Status & tagging log